Skip to content
Permalink
Browse files
revert earlier change and instead restrict RATIO regular expression t…
…o prevent use in calc
  • Loading branch information
kevinhendricks committed Jan 16, 2019
1 parent cf39939 commit 923471b05230b9b56cd57cbdd1f885286325a977
Showing with 3 additions and 6 deletions.
  1. +1 −3 src/css_parser/css/value.py
  2. +2 −3 src/css_parser/cssproductions.py
@@ -755,9 +755,7 @@ def _setCssText(self, cssText):
)

def _operant(): return Choice(_DimensionProd(self),
_CSSVariableProd(self),
PreDef.ratio(),
)
_CSSVariableProd(self))

prods = Sequence(Prod(name='CALC',
match=lambda t, v: t == types.FUNCTION and
@@ -1,5 +1,4 @@
"""productions for css_parser based on a mix of CSS 2.1 and CSS 3 Syntax
productions
"""productions for css_parser based on a mix of CSS 2.1 and CSS 3 Syntax productions
- http://www.w3.org/TR/css3-syntax
- http://www.w3.org/TR/css3-syntax/#grammar0
@@ -76,7 +75,7 @@

('S', r'{s}+'), # 1st in list of general productions
('URI', r'{U}{R}{L}\({w}({string}|{url}*){w}\)'),
('RATIO', r'{w}[0-9]+{w}\/{w}[0-9]+'),
('RATIO', r'(?<!\(){w}[0-9]+{w}\/{w}[0-9]+(?=\))'),
('UNICODE-RANGE', r'{U}\+[0-9A-Fa-f?]{1,6}(\-[0-9A-Fa-f]{1,6})?'),
('IDENT', r'{ident}'),
('FUNCTION', r'{ident}\('),

0 comments on commit 923471b

Please sign in to comment.