Skip to content
Snippets Groups Projects
Commit 973ec101 authored by Douwe Maan's avatar Douwe Maan
Browse files

Merge branch 'fix-diff'

parents d131440d dadc656d
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -12,17 +12,14 @@ module Rouge
def self.analyze_text(text)
return 1 if text.start_with?('Index: ')
return 1 if text.start_with?('diff ')
# TODO: Have a look at pygments here, seems better
return 0.9 if text =~ /\A---.*?\n\+\+\+/m
return 0.9 if text.start_with?('--- ')
end
 
state :root do
rule(/^ .*\n/, Text)
rule(/^---\n/, Text)
rule(/^\+.*\n/, Generic::Inserted)
# Do not highlight the delimiter line
# before the diffstat in email patches.
rule(/^-+ .*\n/, Generic::Deleted)
rule(/^-+.*\n/, Generic::Deleted)
rule(/^!.*\n/, Generic::Strong)
rule(/^@.*\n/, Generic::Subheading)
rule(/^([Ii]ndex|diff).*\n/, Generic::Heading)
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment