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
...@@ -64,7 +64,6 @@ module Gitlab ...@@ -64,7 +64,6 @@ module Gitlab
end end
end end
# TODO (rspeicher): Cleanup
def url_for_merge_request(mr, project) def url_for_merge_request(mr, project)
h = Rails.application.routes.url_helpers h = Rails.application.routes.url_helpers
h.namespace_project_merge_request_url(project.namespace, project, mr, h.namespace_project_merge_request_url(project.namespace, project, mr,
......
...@@ -13,17 +13,8 @@ class Redcarpet::Render::GitlabHTML < Redcarpet::Render::HTML ...@@ -13,17 +13,8 @@ class Redcarpet::Render::GitlabHTML < Redcarpet::Render::HTML
super(options) super(options)
end 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) def normal_text(text)
return text unless text.present? ERB::Util.html_escape_once(text)
text = ERB::Util.html_escape_once(text)
text.gsub("'", "&rsquo;")
end end
# Stolen from Rugments::Plugins::Redcarpet as this module is not required # Stolen from Rugments::Plugins::Redcarpet as this module is not required
...@@ -45,8 +36,6 @@ class Redcarpet::Render::GitlabHTML < Redcarpet::Render::HTML ...@@ -45,8 +36,6 @@ class Redcarpet::Render::GitlabHTML < Redcarpet::Render::HTML
end end
def postprocess(full_document) def postprocess(full_document)
full_document.gsub!("&rsquo;", "'")
unless @template.instance_variable_get("@project_wiki") || @project.nil? unless @template.instance_variable_get("@project_wiki") || @project.nil?
full_document = h.create_relative_links(full_document) full_document = h.create_relative_links(full_document)
end end
......
...@@ -138,7 +138,6 @@ References should be parseable even inside _!<%= merge_request.iid %>_ emphasis. ...@@ -138,7 +138,6 @@ References should be parseable even inside _!<%= merge_request.iid %>_ emphasis.
- Issue: #<%= issue.iid %> - Issue: #<%= issue.iid %>
- Issue in another project: <%= xref %>#<%= xissue.iid %> - Issue in another project: <%= xref %>#<%= xissue.iid %>
- Ignores HTML entities: TODO:&#39;
- Ignored in code: `#<%= issue.iid %>` - Ignored in code: `#<%= issue.iid %>`
- Ignored in links: [Link to #<%= issue.iid %>](#issue-link) - 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