Fix sanitizing lists contents (#11354)
* Add test * Fix code for sanitizing nested lists stripping all tags
This commit is contained in:
parent
730c4053d6
commit
fda437a020
2 changed files with 6 additions and 0 deletions
|
@ -25,6 +25,8 @@ class Sanitize
|
|||
case env[:node_name]
|
||||
when 'li'
|
||||
env[:node].traverse do |node|
|
||||
next unless %w(p ul ol li).include?(node.name)
|
||||
|
||||
node.add_next_sibling('<br>') if node.next_sibling
|
||||
node.replace(node.children) unless node.text?
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue