File tree 2 files changed +2
-1
lines changed
2 files changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ def scan_tokens encoder, options
45
45
if match = scan ( /--- |\+ \+ \+ |=+|_+/ )
46
46
encoder . begin_line line_kind = :head
47
47
encoder . text_token match , :head
48
- if match = scan ( /.* ?(?=$|[\t \n \x00 ]| \( revision)/ )
48
+ if match = scan ( /.+ ?(?=$|[\t \n \x00 ]| \( revision)/ )
49
49
encoder . text_token match , :filename
50
50
if options [ :highlight_code ] && match != '/dev/null'
51
51
file_type = CodeRay ::FileType . fetch ( match , :text )
Original file line number Diff line number Diff line change @@ -93,6 +93,7 @@ def method_missing meth, options = {}
93
93
# This method is used by @Scanner#tokenize@ when called with an Array
94
94
# of source strings. The Diff encoder uses it for inline highlighting.
95
95
def split_into_parts *sizes
96
+ return Array . new ( sizes . size ) { Tokens . new } if size == 2 && first == ''
96
97
parts = [ ]
97
98
opened = [ ]
98
99
content = nil
You can’t perform that action at this time.
0 commit comments