Commit 242bebc1 authored by Robert Speicher's avatar Robert Speicher 🇲🇽

Remove special handling for the `'` problem

While `escape_once` will create this HTML entity, Nokogiri always
translates it back before it gets to IssueReferenceFilter, so there
should be no danger of erroneous issue links.
parent 0027c2dd
Pipeline #20980 passed with stage
......@@ -64,7 +64,6 @@ module Gitlab
end
end
# TODO (rspeicher): Cleanup
def url_for_merge_request(mr, project)
h = Rails.application.routes.url_helpers
h.namespace_project_merge_request_url(project.namespace, project, mr,
......
......@@ -13,17 +13,8 @@ class Redcarpet::Render::GitlabHTML < Redcarpet::Render::HTML
super(options)
end
# If project has issue number 39, apostrophe will be linked in
# regular text to the issue as Redcarpet will convert apostrophe to
# #39;
# We replace apostrophe with right single quote before Redcarpet
# does the processing and put the apostrophe back in postprocessing.
# This only influences regular text, code blocks are untouched.
def normal_text(text)
return text unless text.present?
text = ERB::Util.html_escape_once(text)
text.gsub("'", "&rsquo;")
ERB::Util.html_escape_once(text)
end
# Stolen from Rugments::Plugins::Redcarpet as this module is not required
......@@ -45,8 +36,6 @@ class Redcarpet::Render::GitlabHTML < Redcarpet::Render::HTML
end
def postprocess(full_document)
full_document.gsub!("&rsquo;", "'")
unless @template.instance_variable_get("@project_wiki") || @project.nil?
full_document = h.create_relative_links(full_document)
end
......
......@@ -138,7 +138,6 @@ References should be parseable even inside _!<%= merge_request.iid %>_ emphasis.
- Issue: #<%= issue.iid %>
- Issue in another project: <%= xref %>#<%= xissue.iid %>
- Ignores HTML entities: TODO:&#39;
- Ignored in code: `#<%= issue.iid %>`
- Ignored in links: [Link to #<%= issue.iid %>](#issue-link)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment