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 HTML property: contenteditable #167

Merged
merged 1 commit into from
Sep 28, 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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
* Expand set of allowed CSS functions. [related to #122]
* Allow greater precision in shorthand CSS values. [#149] (Thanks, @danfstucky!)
* Allow CSS property `list-style` [#162] (Thanks, @jaredbeck!)
* Allow HTML property `contenteditable`


### Bug fixes
Expand Down
1 change: 1 addition & 0 deletions lib/loofah/html5/whitelist.rb
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ module WhiteList
"cols",
"colspan",
"compact",
"contenteditable",
"coords",
"datetime",
"dir",
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 @@ -110,6 +110,13 @@ def test_should_allow_multi_word_data_attributes
check_sanitization(input, htmloutput, output, output)
end

def test_should_allow_contenteditable
input = '<p contenteditable="false">Hi!</p>'
output = '<p contenteditable="false">Hi!</p>'

check_sanitization(input, output, output, output)
end

##
## libxml2 downcases attributes, so this is moot.
##
Expand Down