summaryrefslogtreecommitdiff
path: root/lib/banzai
diff options
context:
space:
mode:
authorYorick Peterse <yorickpeterse@gmail.com>2016-04-06 14:24:30 +0200
committerYorick Peterse <yorickpeterse@gmail.com>2016-04-06 14:24:30 +0200
commit507cbca339444eabdfdd5d6dff1237bd00ee636a (patch)
treefc0b873ae5f2f6ec279c22014124cf351117c357 /lib/banzai
parent59466a478038210113b21ffa40530799dcdeed40 (diff)
downloadgitlab-ce-507cbca339444eabdfdd5d6dff1237bd00ee636a.tar.gz
Fix header link rendering when containing numbersfix-markdown-rendering
This fixes the problem where Markdown such as: ### 31st Would get rendered as a link tag pointing to issue number 31 inside a header tag. See gitlab-org/gitlab-ce#14936 for more information.
Diffstat (limited to 'lib/banzai')
-rw-r--r--lib/banzai/filter/abstract_reference_filter.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/banzai/filter/abstract_reference_filter.rb b/lib/banzai/filter/abstract_reference_filter.rb
index f21dbef216c..b8962379cb5 100644
--- a/lib/banzai/filter/abstract_reference_filter.rb
+++ b/lib/banzai/filter/abstract_reference_filter.rb
@@ -119,7 +119,7 @@ module Banzai
elsif element_node?(node)
yield_valid_link(node) do |link, text|
- if ref_pattern && link =~ /\A#{ref_pattern}/
+ if ref_pattern && link =~ /\A#{ref_pattern}\z/
replace_link_node_with_href(node, link) do
object_link_filter(link, ref_pattern, link_text: text)
end