Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
iv
gitlab-ce
Commits
fb5116ca
Commit
fb5116ca
authored
Apr 22, 2015
by
Robert Speicher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use `search_text_nodes` helper in our custom filters
Closes #1477
parent
b5ee60c5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
lib/gitlab/markdown/emoji_filter.rb
lib/gitlab/markdown/emoji_filter.rb
+1
-1
lib/gitlab/markdown/reference_filter.rb
lib/gitlab/markdown/reference_filter.rb
+1
-1
No files found.
lib/gitlab/markdown/emoji_filter.rb
View file @
fb5116ca
...
...
@@ -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
)
...
...
lib/gitlab/markdown/reference_filter.rb
View file @
fb5116ca
...
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment