BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
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
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
emoji_filter.rb
lib/gitlab/markdown/emoji_filter.rb
+1
-1
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
...
@@ -15,7 +15,7 @@ module Gitlab
IGNORED_ANCESTOR_TAGS
=
%w(pre code tt)
.
to_set
IGNORED_ANCESTOR_TAGS
=
%w(pre code tt)
.
to_set
def
call
def
call
doc
.
search
(
'text()'
).
each
do
|
node
|
search_text_nodes
(
doc
).
each
do
|
node
|
content
=
node
.
to_html
content
=
node
.
to_html
next
unless
content
.
include?
(
':'
)
next
unless
content
.
include?
(
':'
)
next
if
has_ancestor?
(
node
,
IGNORED_ANCESTOR_TAGS
)
next
if
has_ancestor?
(
node
,
IGNORED_ANCESTOR_TAGS
)
...
...
lib/gitlab/markdown/reference_filter.rb
View file @
fb5116ca
...
@@ -49,7 +49,7 @@ module Gitlab
...
@@ -49,7 +49,7 @@ module Gitlab
def
replace_text_nodes_matching
(
pattern
)
def
replace_text_nodes_matching
(
pattern
)
return
doc
if
project
.
nil?
return
doc
if
project
.
nil?
doc
.
search
(
'text()'
).
each
do
|
node
|
search_text_nodes
(
doc
).
each
do
|
node
|
content
=
node
.
to_html
content
=
node
.
to_html
next
unless
content
.
match
(
pattern
)
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