Skip to content

Commit

Permalink
Allow uppercase hex chararcters in CSS colour check
Browse files Browse the repository at this point in the history
  • Loading branch information
hugovk committed Nov 30, 2017
1 parent 48fb9e1 commit a5a1900
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion html5lib/filters/sanitizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -855,7 +855,7 @@ def sanitize_css(self, style):
'padding']:
for keyword in value.split():
if keyword not in self.allowed_css_keywords and \
not re.match(r"^(#[0-9a-f]+|rgb\(\d+%?,\d*%?,?\d*%?\)?|\d{0,2}\.?\d{0,2}(cm|em|ex|in|mm|pc|pt|px|%|,|\))?)$", keyword): # noqa
not re.match(r"^(#[0-9a-fA-F]+|rgb\(\d+%?,\d*%?,?\d*%?\)?|\d{0,2}\.?\d{0,2}(cm|em|ex|in|mm|pc|pt|px|%|,|\))?)$", keyword): # noqa
break
else:
clean.append(prop + ': ' + value + ';')
Expand Down

0 comments on commit a5a1900

Please sign in to comment.