Skip to content

Commit c073e4d

Browse files
committed
fix issue with diffs inside of diffs
1 parent 3653123 commit c073e4d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/coderay/scanners/diff.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@ def scan_tokens encoder, options
5050
if match = scan(/.*?(?=$|[\t\n\x00]| \(revision)/)
5151
encoder.text_token match, :filename
5252
if options[:highlight_code]
53-
content_scanner = scanners[FileType.fetch(match, :plaintext)]
53+
file_type = FileType.fetch(match, :text)
54+
file_type = :text if file_type == :diff
55+
content_scanner = scanners[file_type]
5456
content_scanner_entry_state = nil
5557
end
5658
end

0 commit comments

Comments
 (0)