mirror of
https://github.com/ralsina/tartrazine.git
synced 2025-08-05 07:45:33 +00:00
JSON formatter
This commit is contained in:
11
src/formatters/json.cr
Normal file
11
src/formatters/json.cr
Normal file
@@ -0,0 +1,11 @@
|
||||
require "../formatter"
|
||||
|
||||
module Tartrazine
|
||||
class Json < Formatter
|
||||
property name = "json"
|
||||
|
||||
def format(text : String, lexer : Lexer, _theme : Theme) : String
|
||||
lexer.tokenize(text).to_json
|
||||
end
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user