Merge branch 'rs-search_text_nodes' into 'master'

Use `search_text_nodes` helper in our custom filters

Closes #1477

See merge request !561
This commit is contained in:
Dmitriy Zaporozhets 2015-04-23 12:27:36 +00:00
commit 67996c1e03
2 changed files with 2 additions and 2 deletions

View file

@ -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)

View file

@ -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)