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

Prevent result of SyntaxHighlightFilter being sanitized

parent b2f3d024
...@@ -67,12 +67,16 @@ module Gitlab ...@@ -67,12 +67,16 @@ module Gitlab
def clean_spans def clean_spans
lambda do |env| lambda do |env|
return unless env[:node_name] == 'span' node = env[:node]
return unless env[:node].has_attribute?('class')
unless has_ancestor?(env[:node], 'pre') return unless node.name == 'span'
env[:node].remove_attribute('class') return unless node.has_attribute?('class')
unless has_ancestor?(node, 'pre')
node.remove_attribute('class')
end end
{node_whitelist: [node]}
end end
end 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