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 list-style #162

Merged
merged 1 commit into from Apr 23, 2019
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -7,6 +7,7 @@ Features:
* Expand set of allowed protocols to include `tel:` and `line:`. [#104, #147]
* Expand set of allowed CSS functions. [related to #122]
* Allow greater precision in shorthand CSS values. [#149] (Thanks, @danfstucky!)
* Allow CSS property `list-style`


## 2.2.3 / 2018-10-30
Expand Down
1 change: 1 addition & 0 deletions lib/loofah/html5/whitelist.rb
Expand Up @@ -574,6 +574,7 @@ module WhiteList
"height",
"letter-spacing",
"line-height",
"list-style",
"list-style-type",
"overflow",
"pause",
Expand Down
6 changes: 6 additions & 0 deletions test/html5/test_sanitizer.rb
Expand Up @@ -263,6 +263,12 @@ def test_figure_element_is_valid
end
end

def test_css_list_style
html = '<ul style="list-style: none"></ul>'
sane = Nokogiri::HTML(Loofah.scrub_fragment(html, :escape).to_xml)
assert_match %r/list-style/, sane.inner_html
end

def test_css_negative_value_sanitization
html = "<span style=\"letter-spacing:-0.03em;\">"
sane = Nokogiri::HTML(Loofah.scrub_fragment(html, :escape).to_xml)
Expand Down