diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-07-20 15:26:25 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-07-20 15:26:25 +0300 |
commit | a09983ae35713f5a2bbb100981116d31ce99826e (patch) | |
tree | 2ee2af7bd104d57086db360a7e6d8c9d5d43667a /lib/banzai/filter/project_reference_filter.rb | |
parent | 18c5ab32b738c0b6ecb4d0df3994000482f34bd8 (diff) |
Add latest changes from gitlab-org/gitlab@13-2-stable-ee
Diffstat (limited to 'lib/banzai/filter/project_reference_filter.rb')
-rw-r--r-- | lib/banzai/filter/project_reference_filter.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/banzai/filter/project_reference_filter.rb b/lib/banzai/filter/project_reference_filter.rb index 292d4b1d56c..50e23460cb8 100644 --- a/lib/banzai/filter/project_reference_filter.rb +++ b/lib/banzai/filter/project_reference_filter.rb @@ -27,15 +27,15 @@ module Banzai ref_pattern = Project.markdown_reference_pattern ref_pattern_start = /\A#{ref_pattern}\z/ - nodes.each do |node| + nodes.each_with_index do |node, index| if text_node?(node) - replace_text_when_pattern_matches(node, ref_pattern) do |content| + replace_text_when_pattern_matches(node, index, ref_pattern) do |content| project_link_filter(content) end elsif element_node?(node) yield_valid_link(node) do |link, inner_html| if link =~ ref_pattern_start - replace_link_node_with_href(node, link) do + replace_link_node_with_href(node, index, link) do project_link_filter(link, link_content: inner_html) end end |