Skip to content

Commit

Permalink
Allow CSS property: min-width
Browse files Browse the repository at this point in the history
  • Loading branch information
lazyatom committed Oct 22, 2024
1 parent 31b90f2 commit 9f9b0b6
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
Original file line number Diff line number Diff line change
Expand Up @@ -663,6 +663,7 @@ module SafeList
"list-style",
"list-style-type",
"max-width",
"min-width",
"order",
"overflow",
"overflow-x",
Expand Down
7 changes: 7 additions & 0 deletions test/html5/test_sanitizer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,13 @@ def test_css_max_width
assert_match(/max-width/, sane.inner_html)
end

def test_css_min_width
html = '<div style="min-width: 100%;"></div>'
sane = Nokogiri::HTML(Loofah.scrub_html4_fragment(html, :escape).to_xml)

assert_match(/min-width/, sane.inner_html)
end

def test_css_page_break_after
html = '<div style="page-break-after:always;"></div>'
sane = Nokogiri::HTML(Loofah.scrub_html4_fragment(html, :escape).to_xml)
Expand Down

0 comments on commit 9f9b0b6

Please sign in to comment.