about summary refs log tree commit diff
path: root/app
diff options
context:
space:
mode:
authorThibG <thib@sitedethib.com>2019-07-19 01:44:58 +0200
committerEugen Rochko <eugen@zeonfederated.com>2019-07-19 01:44:58 +0200
commitfda437a02088ac114fecb69e3b1e52f495a2dd9a (patch)
tree1994cd719c8433485d82d57c476e6beaa56a7b66 /app
parent730c4053d642024b9949d72c8a9f1873532c6212 (diff)
Fix sanitizing lists contents (#11354)
* Add test

* Fix code for sanitizing nested lists stripping all tags
Diffstat (limited to 'app')
-rw-r--r--app/lib/sanitize_config.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/app/lib/sanitize_config.rb b/app/lib/sanitize_config.rb
index e82a2a33a..aba8ce9f6 100644
--- a/app/lib/sanitize_config.rb
+++ b/app/lib/sanitize_config.rb
@@ -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