提交 fb5116ca 编写于 作者: R Robert Speicher

Use `search_text_nodes` helper in our custom filters

Closes #1477
上级 b5ee60c5
......@@ -15,7 +15,7 @@ module Gitlab
IGNORED_ANCESTOR_TAGS = %w(pre code tt).to_set
def call
doc.search('text()').each do |node|
search_text_nodes(doc).each do |node|
content = node.to_html
next unless content.include?(':')
next if has_ancestor?(node, IGNORED_ANCESTOR_TAGS)
......
......@@ -49,7 +49,7 @@ module Gitlab
def replace_text_nodes_matching(pattern)
return doc if project.nil?
doc.search('text()').each do |node|
search_text_nodes(doc).each do |node|
content = node.to_html
next unless content.match(pattern)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册