Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/helpers/gitlab_markdown_helper.rb2
-rw-r--r--lib/redcarpet/render/gitlab_html.rb2
2 files changed, 2 insertions, 2 deletions
diff --git a/app/helpers/gitlab_markdown_helper.rb b/app/helpers/gitlab_markdown_helper.rb
index 37095652513..45cd199edfc 100644
--- a/app/helpers/gitlab_markdown_helper.rb
+++ b/app/helpers/gitlab_markdown_helper.rb
@@ -50,7 +50,7 @@ module GitlabMarkdownHelper
end
html_doc = Nokogiri::HTML(@markdown.render(text))
html_doc.css(':not(li)').each { |dom| dom[:dir] = :auto }
- html_doc.to_html.gsub(%r{\{anchor=([\w-]+)\}}m) { |match| "<a name=\'#{$1}\'></a>" }.html_safe
+ html_doc.to_html.html_safe
end
# Return the first line of +text+, up to +max_chars+, after parsing the line
diff --git a/lib/redcarpet/render/gitlab_html.rb b/lib/redcarpet/render/gitlab_html.rb
index 54d740908d5..41f6e6b013b 100644
--- a/lib/redcarpet/render/gitlab_html.rb
+++ b/lib/redcarpet/render/gitlab_html.rb
@@ -49,7 +49,7 @@ class Redcarpet::Render::GitlabHTML < Redcarpet::Render::HTML
"<h#{level}>#{text}</h#{level}>"
else
id = ActionController::Base.helpers.strip_tags(h.gfm(text)).downcase() \
- .gsub(/[^a-z0-9_-]/, '-').gsub(/-+/, '-').gsub(/^-/, '').gsub(/-$/, '')
+ .gsub(/[^\p{Word}-]/, '-').gsub(/-+/, '-').gsub(/^-/, '').gsub(/-$/, '')
"<h#{level} id=\"#{id}\">#{text}<a href=\"\##{id}\"></a></h#{level}>"
end
end