summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorKornelius Kalnbach <murphy@rubychan.de>2013-06-23 14:53:14 +0200
committerKornelius Kalnbach <murphy@rubychan.de>2013-06-23 14:53:14 +0200
commitb89caf96d1cfc304c2114d8734ebe8b91337c799 (patch)
treebcf72f68d74d500defd359d05449fdd91f28a08f /lib
parent844975b53233b4697d1385548c1295ce18a7be72 (diff)
downloadcoderay-b89caf96d1cfc304c2114d8734ebe8b91337c799.tar.gz
fix diff/json token nesting issue
Diffstat (limited to 'lib')
-rw-r--r--lib/coderay/scanners/json.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/coderay/scanners/json.rb b/lib/coderay/scanners/json.rb
index 3754a9b..b09970c 100644
--- a/lib/coderay/scanners/json.rb
+++ b/lib/coderay/scanners/json.rb
@@ -26,6 +26,10 @@ module Scanners
def scan_tokens encoder, options
state = options[:state] || @state
+ if [:string, :key].include? state
+ encoder.begin_group state
+ end
+
until eos?
case state