From b256ecf98a6f2d15519c75ecb2ee53b8d4492ba9 Mon Sep 17 00:00:00 2001 From: Kornelius Kalnbach Date: Fri, 9 Sep 2011 00:48:50 +0200 Subject: diff scanner: highlight "\ No newline" as :comment --- lib/coderay/scanners/diff.rb | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'lib/coderay/scanners/diff.rb') diff --git a/lib/coderay/scanners/diff.rb b/lib/coderay/scanners/diff.rb index 34eb158..fd70016 100644 --- a/lib/coderay/scanners/diff.rb +++ b/lib/coderay/scanners/diff.rb @@ -69,11 +69,8 @@ module Scanners next unless match = scan(/.+/) encoder.text_token match, :plain state = :added - elsif match = scan(/\\ /) - encoder.begin_line line_kind = :change - encoder.text_token match, :change - next unless match = scan(/.+/) - encoder.text_token match, :plain + elsif match = scan(/\\ .*/) + encoder.text_token match, :comment elsif match = scan(/@@(?>[^@\n]*)@@/) content_scanner.state = :initial unless match?(/\n\+/) content_scanner_entry_state = nil -- cgit v1.2.1