diff options
author | Yorick Peterse <yorickpeterse@gmail.com> | 2016-04-06 14:24:30 +0200 |
---|---|---|
committer | Yorick Peterse <yorickpeterse@gmail.com> | 2016-04-06 14:24:30 +0200 |
commit | 507cbca339444eabdfdd5d6dff1237bd00ee636a (patch) | |
tree | fc0b873ae5f2f6ec279c22014124cf351117c357 /lib/banzai | |
parent | 59466a478038210113b21ffa40530799dcdeed40 (diff) | |
download | gitlab-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.rb | 2 |
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 |