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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
b53f9d90
Commit
b53f9d90
authored
Jun 04, 2020
by
Aleksei Lipniagov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cache repeated class method calls
parent
b9baf938
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
lib/banzai/filter/project_reference_filter.rb
lib/banzai/filter/project_reference_filter.rb
+5
-2
No files found.
lib/banzai/filter/project_reference_filter.rb
View file @
b53f9d90
...
@@ -24,7 +24,6 @@ module Banzai
...
@@ -24,7 +24,6 @@ module Banzai
end
end
def
call
def
call
ref_pattern
=
Project
.
markdown_reference_pattern
ref_pattern_start
=
/\A
#{
ref_pattern
}
\z/
ref_pattern_start
=
/\A
#{
ref_pattern
}
\z/
nodes
.
each
do
|
node
|
nodes
.
each
do
|
node
|
...
@@ -83,7 +82,7 @@ module Banzai
...
@@ -83,7 +82,7 @@ module Banzai
refs
=
Set
.
new
refs
=
Set
.
new
nodes
.
each
do
|
node
|
nodes
.
each
do
|
node
|
node
.
to_html
.
scan
(
Project
.
markdown_reference
_pattern
)
do
node
.
to_html
.
scan
(
ref
_pattern
)
do
refs
<<
"
#{
$~
[
:namespace
]
}
/
#{
$~
[
:project
]
}
"
refs
<<
"
#{
$~
[
:namespace
]
}
/
#{
$~
[
:project
]
}
"
end
end
end
end
...
@@ -112,6 +111,10 @@ module Banzai
...
@@ -112,6 +111,10 @@ module Banzai
def
link_tag
(
url
,
data
,
link_content
,
title
)
def
link_tag
(
url
,
data
,
link_content
,
title
)
%(<a href="#{url}" #{data} class="#{link_class}" title="#{escape_once(title)}">#{link_content}</a>)
%(<a href="#{url}" #{data} class="#{link_class}" title="#{escape_once(title)}">#{link_content}</a>)
end
end
def
ref_pattern
@ref_pattern
||=
Project
.
markdown_reference_pattern
end
end
end
end
end
end
end
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