From 2d17c46994928ea2479f8dcae0332906aa994e34 Mon Sep 17 00:00:00 2001 From: Maxime Kjaer Date: Sun, 17 Nov 2019 12:41:37 +0100 Subject: [PATCH] Fix json-doc lexer --- lib/rouge/lexers/json_doc.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/rouge/lexers/json_doc.rb b/lib/rouge/lexers/json_doc.rb index e545a6d8b9..d27bd7bac8 100644 --- a/lib/rouge/lexers/json_doc.rb +++ b/lib/rouge/lexers/json_doc.rb @@ -6,16 +6,17 @@ module Lexers load_lexer 'json.rb' class JSONDOC < JSON - desc "JavaScript Object Notation with extenstions for documentation" + desc "JavaScript Object Notation with extensions for documentation" tag 'json-doc' - prepend :root do + prepend :name do rule %r/([$\w]+)(\s*)(:)/ do groups Name::Attribute, Text, Punctuation end + end + prepend :value do rule %r(/[*].*?[*]/), Comment - rule %r(//.*?$), Comment::Single rule %r/(\.\.\.)/, Comment::Single end