From fda437a02088ac114fecb69e3b1e52f495a2dd9a Mon Sep 17 00:00:00 2001 From: ThibG Date: Fri, 19 Jul 2019 01:44:58 +0200 Subject: Fix sanitizing lists contents (#11354) * Add test * Fix code for sanitizing nested lists stripping all tags --- app/lib/sanitize_config.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'app/lib') 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('
') if node.next_sibling node.replace(node.children) unless node.text? end -- cgit