summaryrefslogtreecommitdiff
path: root/lib/banzai/filter/table_of_contents_filter.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/banzai/filter/table_of_contents_filter.rb')
-rw-r--r--lib/banzai/filter/table_of_contents_filter.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/banzai/filter/table_of_contents_filter.rb b/lib/banzai/filter/table_of_contents_filter.rb
index 47151626208..97244159985 100644
--- a/lib/banzai/filter/table_of_contents_filter.rb
+++ b/lib/banzai/filter/table_of_contents_filter.rb
@@ -32,6 +32,7 @@ module Banzai
.gsub(PUNCTUATION_REGEXP, '') # remove punctuation
.tr(' ', '-') # replace spaces with dash
.squeeze('-') # replace multiple dashes with one
+ .gsub(/\A(\d+)\z/, 'anchor-\1') # digits-only hrefs conflict with issue refs
uniq = headers[id] > 0 ? "-#{headers[id]}" : ''
headers[id] += 1