summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRobert Speicher <rspeicher@gmail.com>2015-04-30 16:13:33 -0400
committerRobert Speicher <rspeicher@gmail.com>2015-04-30 16:35:27 -0400
commit242bebc13483c281af8bd2e0e9f6d7346997481e (patch)
tree39f56351f1dc6866d8701f93dbc975c006e2fed1 /lib
parent0027c2ddd78942e7fc266f68ccfdb17e2a525554 (diff)
downloadgitlab-ce-242bebc13483c281af8bd2e0e9f6d7346997481e.tar.gz
Remove special handling for the `&#39;` 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.
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/markdown/merge_request_reference_filter.rb1
-rw-r--r--lib/redcarpet/render/gitlab_html.rb13
2 files changed, 1 insertions, 13 deletions
diff --git a/lib/gitlab/markdown/merge_request_reference_filter.rb b/lib/gitlab/markdown/merge_request_reference_filter.rb
index 7c28fe112ef..740d72abb36 100644
--- a/lib/gitlab/markdown/merge_request_reference_filter.rb
+++ b/lib/gitlab/markdown/merge_request_reference_filter.rb
@@ -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,
diff --git a/lib/redcarpet/render/gitlab_html.rb b/lib/redcarpet/render/gitlab_html.rb
index 5a87b230579..bea66e6cdc1 100644
--- a/lib/redcarpet/render/gitlab_html.rb
+++ b/lib/redcarpet/render/gitlab_html.rb
@@ -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