From 667d4262e42b5866859fb9eb91a0617c1722e7a4 Mon Sep 17 00:00:00 2001 From: Kornelius Kalnbach Date: Sun, 9 Jun 2013 06:24:29 +0200 Subject: avoid empty tokens in Diff output, fix split_into_parts --- lib/coderay/tokens.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/coderay/tokens.rb') diff --git a/lib/coderay/tokens.rb b/lib/coderay/tokens.rb index c747017..6957d69 100644 --- a/lib/coderay/tokens.rb +++ b/lib/coderay/tokens.rb @@ -93,6 +93,7 @@ module CodeRay # This method is used by @Scanner#tokenize@ when called with an Array # of source strings. The Diff encoder uses it for inline highlighting. def split_into_parts *sizes + return Array.new(sizes.size) { Tokens.new } if size == 2 && first == '' parts = [] opened = [] content = nil -- cgit v1.2.1