Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow CSS property: min-width #287

Merged
merged 1 commit into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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