Skip to content

Commit a5a1900

Browse files
committed
Allow uppercase hex chararcters in CSS colour check
1 parent 48fb9e1 commit a5a1900

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

html5lib/filters/sanitizer.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -855,7 +855,7 @@ def sanitize_css(self, style):
855855
'padding']:
856856
for keyword in value.split():
857857
if keyword not in self.allowed_css_keywords and \
858-
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
858+
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
859859
break
860860
else:
861861
clean.append(prop + ': ' + value + ';')

0 commit comments

Comments
 (0)