summaryrefslogtreecommitdiff
path: root/lib/banzai
diff options
context:
space:
mode:
authorAdam Niedzielski <adamsunday@gmail.com>2017-04-19 17:15:36 +0200
committerAdam Niedzielski <adamsunday@gmail.com>2017-04-19 18:36:12 +0200
commit1269ee4c3bd3a7875fdcd15554b904fab94fba50 (patch)
tree35e47d697dce43be30ce21b1c74cda78b15192cc /lib/banzai
parent29ddc15f8d9b094bb7052875f7728ee48f7ad06b (diff)
downloadgitlab-ce-1269ee4c3bd3a7875fdcd15554b904fab94fba50.tar.gz
Do not append issuable state to links with custom anchorissuable-state-custom-links
Closes #30916 Change the presentation from [closed] to (closed)
Diffstat (limited to 'lib/banzai')
-rw-r--r--lib/banzai/filter/issuable_state_filter.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/banzai/filter/issuable_state_filter.rb b/lib/banzai/filter/issuable_state_filter.rb
index 1a9d03beb51..327ea9449a1 100644
--- a/lib/banzai/filter/issuable_state_filter.rb
+++ b/lib/banzai/filter/issuable_state_filter.rb
@@ -15,8 +15,8 @@ module Banzai
issuables = extractor.extract([doc])
issuables.each do |node, issuable|
- if VISIBLE_STATES.include?(issuable.state) && node.children.present?
- node.add_child(Nokogiri::XML::Text.new(" [#{issuable.state}]", doc))
+ if VISIBLE_STATES.include?(issuable.state) && node.inner_html == issuable.reference_link_text(project)
+ node.content += " (#{issuable.state})"
end
end