From 9f9b0b6a12e060952c4a83d31b9e573426a47a4b Mon Sep 17 00:00:00 2001 From: James Adam Date: Tue, 22 Oct 2024 13:13:47 +0100 Subject: [PATCH] Allow CSS property: min-width --- lib/loofah/html5/safelist.rb | 1 + test/html5/test_sanitizer.rb | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/lib/loofah/html5/safelist.rb b/lib/loofah/html5/safelist.rb index 18a5450..882107c 100644 --- a/lib/loofah/html5/safelist.rb +++ b/lib/loofah/html5/safelist.rb @@ -663,6 +663,7 @@ module SafeList "list-style", "list-style-type", "max-width", + "min-width", "order", "overflow", "overflow-x", diff --git a/test/html5/test_sanitizer.rb b/test/html5/test_sanitizer.rb index 8f533f6..9f85152 100755 --- a/test/html5/test_sanitizer.rb +++ b/test/html5/test_sanitizer.rb @@ -500,6 +500,13 @@ def test_css_max_width assert_match(/max-width/, sane.inner_html) end + def test_css_min_width + html = '
' + 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 = '
' sane = Nokogiri::HTML(Loofah.scrub_html4_fragment(html, :escape).to_xml)