Skip to content

Commit

Permalink
Allow css names such as -moz-use-text-color, fix mozilla#31, fix mozi…
Browse files Browse the repository at this point in the history
  • Loading branch information
adamlofts authored and James Socol committed Jun 14, 2011
1 parent 3657f7e commit 33edbc5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion bleach/sanitizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def sanitize_css(self, style):
style = re.compile('url\s*\(\s*[^\s)]+?\s*\)\s*').sub(' ', style)

# gauntlet
if not re.match("""^([:,;#%.\sa-zA-Z0-9!]|\w-\w|'[\s\w]+"""
if not re.match("""^([-:,;#%.\sa-zA-Z0-9!]|\w-\w|'[\s\w]+"""
"""'|"[\s\w]+"|\([\d,\s]+\))*$""",
style):
return ''
Expand Down
1 change: 1 addition & 0 deletions bleach/tests/test_css.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ def test_allowed_css():
('color: red; float: left; padding: 1em;', 'color: red; float: left;',
['color', 'float']),
('color: red; float: left; padding: 1em;', 'color: red;', ['color']),
('cursor: -moz-grab;', 'cursor: -moz-grab;', ['cursor']),
)

p = '<p style="%s">bar</p>'
Expand Down

0 comments on commit 33edbc5

Please sign in to comment.