lib/css_parser/regexps.rb in css_parser-1.8.0 vs lib/css_parser/regexps.rb in css_parser-1.9.0
- old
+ new
@@ -20,10 +20,11 @@
RE_INHERIT = regex_possible_values 'inherit'
RE_URI = /(url\(\s*(\s*#{RE_STRING}\s*)\s*\))|(url\(\s*([!#$%&*\-~]|#{RE_NON_ASCII}|#{RE_ESCAPE})*\s*)\)/ixm.freeze
URI_RX = /url\(("([^"]*)"|'([^']*)'|([^)]*))\)/im.freeze
+ URI_RX_OR_NONE = Regexp.union(URI_RX, /none/i)
RE_GRADIENT = /[-a-z]*gradient\([-a-z0-9 .,#%()]*\)/im.freeze
# Initial parsing
RE_AT_IMPORT_RULE = /@import\s+(url\()?["']?(.[^'"\s]*)["']?\)?([\w\s,^\])]*)\)?;?/.freeze
@@ -41,9 +42,10 @@
'disc', 'circle', 'square', 'decimal-leading-zero', 'decimal', 'lower-roman',
'upper-roman', 'lower-greek', 'lower-alpha', 'lower-latin', 'upper-alpha',
'upper-latin', 'hebrew', 'armenian', 'georgian', 'cjk-ideographic', 'hiragana',
'hira-gana-iroha', 'katakana-iroha', 'katakana', 'none'
)
+ RE_IMAGE = Regexp.union(CssParser::URI_RX, CssParser::RE_GRADIENT, /none/i)
STRIP_CSS_COMMENTS_RX = %r{/\*.*?\*/}m.freeze
STRIP_HTML_COMMENTS_RX = /<!--|-->/m.freeze
# Special units