Skip to content

Commit

Permalink
Allow CSS property: max-width
Browse files Browse the repository at this point in the history
  • Loading branch information
Bill Chaney committed Nov 22, 2019
1 parent e5a9ae8 commit 2699b61
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/loofah/html5/safelist.rb
Expand Up @@ -573,6 +573,7 @@ module SafeList
"line-height",
"list-style",
"list-style-type",
"max-width",
"overflow",
"pause",
"pause-after",
Expand Down
7 changes: 7 additions & 0 deletions test/html5/test_sanitizer.rb
Expand Up @@ -326,6 +326,13 @@ def test_css_function_sanitization_strips_style_attributes_with_unsafe_functions
assert_match %r/<span><\/span>/, sane.inner_html
end

def test_css_max_width
html = '<div style="max-width: 100%;"></div>'
sane = Nokogiri::HTML(Loofah.scrub_fragment(html, :escape).to_xml)
assert_match %r/max-width/, sane.inner_html
end


def test_issue_90_slow_regex
skip("timing tests are hard to make pass and have little regression-testing value")

Expand Down

0 comments on commit 2699b61

Please sign in to comment.