diff options
author | Achilleas Pipinellis <axil@gitlab.com> | 2018-06-15 12:08:15 +0300 |
---|---|---|
committer | Achilleas Pipinellis <axil@gitlab.com> | 2018-06-15 12:08:15 +0300 |
commit | 43be7733aad215c48af9b85457947c1d94a73b60 (patch) | |
tree | a2f9135133686c430e61c7923610a68d0338b70d | |
parent | 013dbab9c67d081c3b77538dca66e96b026c62e3 (diff) | |
parent | 040a9839f407e1978217898e950a15a297686313 (diff) |
Merge branch 'master' of gitlab.com:gitlab-com/gitlab-docs
-rw-r--r-- | lib/helpers/redcarpet_render.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/helpers/redcarpet_render.rb b/lib/helpers/redcarpet_render.rb index fe59d31e..86e2a07e 100644 --- a/lib/helpers/redcarpet_render.rb +++ b/lib/helpers/redcarpet_render.rb @@ -12,6 +12,7 @@ module Nanoc::Helpers anchor = text.gsub(/\s+/, '-').gsub(/<\/?[^>]*>/, '').downcase # https://github.com/rails/rails/blob/e491b2c06329afb3c989261a2865d2a93c8b84b8/activesupport/lib/active_support/inflector/transliterate.rb#L86 anchor.gsub!(/[^a-z0-9\-_]+/i, '-') + anchor.gsub!(/39-/, '') # remove weird symbol https://gitlab.com/gitlab-com/gitlab-docs/issues/84 anchor.squeeze!('-') # replace multiple dashes with one anchor.gsub!(/^-|-$/, '') # remove any first or last dashes |