rouge 1.10.0 → 1.10.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rouge/lexers/diff.rb +3 -6
- data/lib/rouge/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 97effe9cafa1378b8091163a176fabb3a0157c9e
|
4
|
+
data.tar.gz: a594ae8d0e46031aadea8ec3662b660310a4e0ff
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fb0e3c6b15a4e79c6239b93a4d82ff46863aa2ce8c3e11c971358b908a80927209db3912d696c7786aabd2134bd8d2822fad774ca08e98eec21ac366f7120e53
|
7
|
+
data.tar.gz: daca6241c49f157150f0cefcfaf201cd96bb4a510b3cc0bb2ff71653726216b142a5fb8b1c287e1af7efd46b93a214253fb8e818984c1c0a342e5d1400e5d3a6
|
data/lib/rouge/lexers/diff.rb
CHANGED
@@ -12,17 +12,14 @@ module Rouge
|
|
12
12
|
def self.analyze_text(text)
|
13
13
|
return 1 if text.start_with?('Index: ')
|
14
14
|
return 1 if text.start_with?('diff ')
|
15
|
-
|
16
|
-
# TODO: Have a look at pygments here, seems better
|
17
|
-
return 0.9 if text =~ /\A---.*?\n\+\+\+/m
|
15
|
+
return 0.9 if text.start_with?('--- ')
|
18
16
|
end
|
19
17
|
|
20
18
|
state :root do
|
21
19
|
rule(/^ .*\n/, Text)
|
20
|
+
rule(/^---\n/, Text)
|
22
21
|
rule(/^\+.*\n/, Generic::Inserted)
|
23
|
-
|
24
|
-
# before the diffstat in email patches.
|
25
|
-
rule(/^-+ .*\n/, Generic::Deleted)
|
22
|
+
rule(/^-+.*\n/, Generic::Deleted)
|
26
23
|
rule(/^!.*\n/, Generic::Strong)
|
27
24
|
rule(/^@.*\n/, Generic::Subheading)
|
28
25
|
rule(/^([Ii]ndex|diff).*\n/, Generic::Heading)
|
data/lib/rouge/version.rb
CHANGED