Skip to content

Commit

Permalink
Allow HTML property: contenteditable
Browse files Browse the repository at this point in the history
  • Loading branch information
andreynering committed May 21, 2019
1 parent 49f1789 commit f70928c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
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

0 comments on commit f70928c

Please sign in to comment.