Commit 7cbf5e4d authored by Robert Speicher's avatar Robert Speicher

Prevent result of SyntaxHighlightFilter being sanitized

parent b2f3d024
......@@ -67,12 +67,16 @@ module Gitlab
def clean_spans
lambda do |env|
return unless env[:node_name] == 'span'
return unless env[:node].has_attribute?('class')
node = env[:node]
unless has_ancestor?(env[:node], 'pre')
env[:node].remove_attribute('class')
return unless node.name == 'span'
return unless node.has_attribute?('class')
unless has_ancestor?(node, 'pre')
node.remove_attribute('class')
end
{node_whitelist: [node]}
end
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment