summaryrefslogtreecommitdiff
path: root/lib/gitlab/markdown/filter/table_of_contents_filter.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gitlab/markdown/filter/table_of_contents_filter.rb')
-rw-r--r--lib/gitlab/markdown/filter/table_of_contents_filter.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/gitlab/markdown/filter/table_of_contents_filter.rb b/lib/gitlab/markdown/filter/table_of_contents_filter.rb
index bbb3bf7fc8b..6be644b0f67 100644
--- a/lib/gitlab/markdown/filter/table_of_contents_filter.rb
+++ b/lib/gitlab/markdown/filter/table_of_contents_filter.rb
@@ -31,7 +31,7 @@ module Gitlab
id = text.downcase
id.gsub!(PUNCTUATION_REGEXP, '') # remove punctuation
- id.gsub!(' ', '-') # replace spaces with dash
+ id.tr!(' ', '-') # replace spaces with dash
id.squeeze!('-') # replace multiple dashes with one
uniq = (headers[id] > 0) ? "-#{headers[id]}" : ''