Skip to content
Snippets Groups Projects
Commit 67996c1e authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
Browse files

Merge branch 'rs-search_text_nodes' into 'master'

Use `search_text_nodes` helper in our custom filters

Closes #1477

See merge request !561
parents 1c96b0b9 fb5116ca
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -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)
Loading
Loading
Loading
Loading
@@ -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)
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment