diff options
author | Achilleas Pipinellis <axilleas@axilleas.me> | 2016-11-23 14:48:09 +0300 |
---|---|---|
committer | Achilleas Pipinellis <axilleas@axilleas.me> | 2016-11-23 16:02:57 +0300 |
commit | 6bfa43c1e487befb1a113e498fc6fa17cd658382 (patch) | |
tree | 4c46db234a3d156b84eaa98f9b952917d95ffc30 /lib/helpers_.rb | |
parent | a91ad32346b4da89196e8f7395c6cb3f480f6085 (diff) |
Replace punctuation with dash
Diffstat (limited to 'lib/helpers_.rb')
-rw-r--r-- | lib/helpers_.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/helpers_.rb b/lib/helpers_.rb index 3de84452..35e0afb4 100644 --- a/lib/helpers_.rb +++ b/lib/helpers_.rb @@ -16,7 +16,7 @@ class HTML < Redcarpet::Render::HTML def header(text, header_level) # https://gitlab.com/gitlab-org/gitlab-ce/blob/0676c5c7140ccf5b809eddab79b6fb78b7db0a66/lib/banzai/filter/table_of_contents_filter.rb#L29-32 anchor = text.downcase - anchor.gsub!(PUNCTUATION_REGEXP, '') # remove punctuation + anchor.gsub!(PUNCTUATION_REGEXP, '-') # replace punctuation with dash anchor.tr!(' ', '-') # replace spaces with dash anchor.squeeze!('-') # replace multiple dashes with one |