From d6fe4e777a4f543c8828dbf77e955ab38e6c2803 Mon Sep 17 00:00:00 2001 From: murphy Date: Wed, 22 Jun 2011 07:22:23 +0000 Subject: #309 Improved highlighting of Ruby inside diffs --- lib/coderay/tokens.rb | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'lib/coderay/tokens.rb') diff --git a/lib/coderay/tokens.rb b/lib/coderay/tokens.rb index e7da7e8..f6f8845 100644 --- a/lib/coderay/tokens.rb +++ b/lib/coderay/tokens.rb @@ -223,12 +223,15 @@ module CodeRay content_or_kind end end - parts << part.concat(closing) - part = Tokens.new + part.concat closing + begin + parts << part + part = Tokens.new + size = sizes[i += 1] + end until size.nil? || size > 0 # ...and open them again. part.concat opened.flatten part_size = 0 - size = sizes[i += 1] redo unless content.empty? else part << content << item -- cgit v1.2.1