lib/rouge/lexers/diff.rb in rouge-3.3.0 vs lib/rouge/lexers/diff.rb in rouge-3.4.0
- old
+ new
@@ -17,17 +17,21 @@
return true if text =~ /(---|[+][+][+]).*?\n(---|[+][+][+])/
end
state :root do
rule(/^ .*$\n?/, Text)
- rule(/^---$\n?/, Text)
+ rule(/^---$\n?/, Punctuation)
+ rule(/^[+>]+.*$\n?/, Generic::Inserted)
rule(/^\+.*$\n?/, Generic::Inserted)
- rule(/^-+.*$\n?/, Generic::Deleted)
+ rule(/^[-<]+.*$\n?/, Generic::Deleted)
rule(/^!.*$\n?/, Generic::Strong)
- rule(/^@.*$\n?/, Generic::Subheading)
rule(/^([Ii]ndex|diff).*$\n?/, Generic::Heading)
+ rule(/^(@@[^@]*@@)([^\n]*\n)/) do
+ groups Punctuation, Text
+ end
+ rule(/^\w.*$\n?/, Punctuation)
rule(/^=.*$\n?/, Generic::Heading)
- rule(/.*$\n?/, Text)
+ rule(/\s.*$\n?/, Text)
end
end
end
end