rouge 3.1.0 → 3.1.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/html.rb +3 -2
- data/lib/rouge/lexers/javascript.rb +1 -1
- data/lib/rouge/lexers/perl.rb +1 -1
- data/lib/rouge/lexers/swift.rb +2 -2
- data/lib/rouge/lexers/vue.rb +4 -2
- data/lib/rouge/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 62be258d2b0e790b9b5d6d0f3bb60f10c6289070
|
4
|
+
data.tar.gz: c82dd182157e45af5a1f4b085b07de6c04b9ae0c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b40ecda85a555cc87f3e97fdf8bfd34883c2d0fa57e41ab2d7e5d9e7520de9f1e4e535f00fe55e8a6fc86c9739d7129dece7367157f5d61b17e6572583e58743
|
7
|
+
data.tar.gz: 7484742aa3b5550cb327e565fbd332f63631dbf1121a62d74eb280a68e5ca333b1c40bdace57cc064c8a0a3dddccca0e14bc1f2d1c3a9aad605c39d330d72f90
|
data/lib/rouge/lexers/html.rb
CHANGED
@@ -37,6 +37,7 @@ module Rouge
|
|
37
37
|
rule /<\s*style\s*/m do
|
38
38
|
token Name::Tag
|
39
39
|
@css.reset!
|
40
|
+
@lang = @css
|
40
41
|
push :style_content
|
41
42
|
push :tag
|
42
43
|
end
|
@@ -124,13 +125,13 @@ module Rouge
|
|
124
125
|
|
125
126
|
state :style_content do
|
126
127
|
rule /[^<]+/ do
|
127
|
-
delegate @
|
128
|
+
delegate @lang
|
128
129
|
end
|
129
130
|
|
130
131
|
rule %r(<\s*/\s*style\s*>)m, Name::Tag, :pop!
|
131
132
|
|
132
133
|
rule /</ do
|
133
|
-
delegate @
|
134
|
+
delegate @lang
|
134
135
|
end
|
135
136
|
end
|
136
137
|
end
|
data/lib/rouge/lexers/perl.rb
CHANGED
@@ -104,6 +104,7 @@ module Rouge
|
|
104
104
|
rule /__END__\b/, Comment::Preproc, :end_part
|
105
105
|
rule /\$\^[ADEFHILMOPSTWX]/, Name::Variable::Global
|
106
106
|
rule /\$[\\"'\[\]&`+*.,;=%~?@$!<>(^\|\/-](?!\w)/, Name::Variable::Global
|
107
|
+
rule /[-+\/*%=<>&^\|!\\~]=?/, Operator
|
107
108
|
rule /[$@%#]+/, Name::Variable, :varname
|
108
109
|
|
109
110
|
rule /0_?[0-7]+(_[0-7]+)*/, Num::Oct
|
@@ -128,7 +129,6 @@ module Rouge
|
|
128
129
|
rule /sub\s+/, Keyword, :funcname
|
129
130
|
rule /\[\]|\*\*|::|<<|>>|>=|<=|<=>|={3}|!=|=~|!~|&&?|\|\||\.{1,3}/,
|
130
131
|
Operator
|
131
|
-
rule /[-+\/*%=<>&^\|!\\~]=?/, Operator
|
132
132
|
rule /[()\[\]:;,<>\/?{}]/, Punctuation
|
133
133
|
rule(/(?=\w)/) { push :name }
|
134
134
|
end
|
data/lib/rouge/lexers/swift.rb
CHANGED
@@ -112,8 +112,8 @@ module Rouge
|
|
112
112
|
push :tuple
|
113
113
|
end
|
114
114
|
|
115
|
-
rule /(?!\b(if|while|for|private|internal|unowned|switch|case)\b)\b#{id}(?=(\?|!)?\s*[(
|
116
|
-
if m[
|
115
|
+
rule /(?!\b(if|while|for|private|internal|unowned|switch|case)\b)\b#{id}(?=(\?|!)?\s*[(])/ do |m|
|
116
|
+
if m[0] =~ /^[[:upper:]]/
|
117
117
|
token Keyword::Type
|
118
118
|
else
|
119
119
|
token Name::Function
|
data/lib/rouge/lexers/vue.rb
CHANGED
@@ -16,13 +16,15 @@ module Rouge
|
|
16
16
|
end
|
17
17
|
|
18
18
|
def lookup_lang(lang)
|
19
|
+
lang.downcase!
|
20
|
+
lang = lang.gsub(/["']*/, '')
|
19
21
|
case lang
|
20
22
|
when 'html' then HTML
|
21
23
|
when 'css' then CSS
|
22
24
|
when 'javascript' then Javascript
|
23
25
|
when 'sass' then Sass
|
24
26
|
when 'scss' then Scss
|
25
|
-
when 'coffee' then
|
27
|
+
when 'coffee' then Coffeescript
|
26
28
|
# TODO: add more when the lexers are done
|
27
29
|
else
|
28
30
|
PlainText
|
@@ -77,7 +79,7 @@ module Rouge
|
|
77
79
|
state :lang_tag do
|
78
80
|
rule /(lang\s*=)(\s*)("(?:\\.|[^\\])*?"|'(\\.|[^\\])*?'|[^\s>]+)/ do |m|
|
79
81
|
groups Name::Attribute, Text, Str
|
80
|
-
@lang = lookup_lang(m[
|
82
|
+
@lang = lookup_lang(m[3])
|
81
83
|
end
|
82
84
|
|
83
85
|
mixin :tag
|
data/lib/rouge/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rouge
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.1.
|
4
|
+
version: 3.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeanine Adkisson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-01-31 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Rouge aims to a be a simple, easy-to-extend drop-in replacement for pygments.
|
14
14
|
email:
|