lib/rouge/lexers/diff.rb in rouge-3.30.0 vs lib/rouge/lexers/diff.rb in rouge-4.0.0
- old
+ new
@@ -18,20 +18,30 @@
end
state :root do
rule(/^ .*$\n?/, Text)
rule(/^---$\n?/, Punctuation)
- rule(/^[+>]+.*$\n?/, Generic::Inserted)
- rule(/^\+.*$\n?/, Generic::Inserted)
- rule(/^[-<]+.*$\n?/, Generic::Deleted)
+
+ rule %r(
+ (^\++.*$\n?) |
+ (^>+[ \t]+.*$\n?) |
+ (^>+$\n?)
+ )x, Generic::Inserted
+
+ rule %r(
+ (^-+.*$\n?) |
+ (^<+[ \t]+.*$\n?) |
+ (^<+$\n?)
+ )x, Generic::Deleted
+
rule(/^!.*$\n?/, Generic::Strong)
rule(/^([Ii]ndex|diff).*$\n?/, Generic::Heading)
rule(/^(@@[^@]*@@)([^\n]*\n)/) do
groups Punctuation, Text
end
rule(/^\w.*$\n?/, Punctuation)
rule(/^=.*$\n?/, Generic::Heading)
- rule(/\s.*$\n?/, Text)
+ rule(/.+$\n?/, Text)
end
end
end
end