diff --git a/lib/redcarpet/render/gitlab_html.rb b/lib/redcarpet/render/gitlab_html.rb index 53c5a1e09c0..511619631fd 100644 --- a/lib/redcarpet/render/gitlab_html.rb +++ b/lib/redcarpet/render/gitlab_html.rb @@ -49,6 +49,7 @@ class Redcarpet::Render::GitlabHTML < Redcarpet::Render::HTML end def postprocess(full_document) + full_document.gsub!("’", "'") unless @template.instance_variable_get("@project_wiki") || @project.nil? full_document = h.create_relative_links(full_document) end diff --git a/spec/helpers/gitlab_markdown_helper_spec.rb b/spec/helpers/gitlab_markdown_helper_spec.rb index 0784834924c..f5e68687b53 100644 --- a/spec/helpers/gitlab_markdown_helper_spec.rb +++ b/spec/helpers/gitlab_markdown_helper_spec.rb @@ -535,7 +535,7 @@ describe GitlabMarkdownHelper do project.issues.stub(:where).with(iid: '39').and_return([issue]) actual = "Yes, it is @#{member.user.username}'s task." - expected = /Yes, it is @#{member.user.username}<\/a>’s task/ + expected = /Yes, it is @#{member.user.username}<\/a>'s task/ markdown(actual).should match(expected) end @@ -574,7 +574,7 @@ describe GitlabMarkdownHelper do it "should leave inline code untouched" do markdown("\nDon't use `$#{snippet.id}` here.\n").should == - "

Don’t use $#{snippet.id} here.

\n" + "

Don't use $#{snippet.id} here.

\n" end it "should leave ref-like autolinks untouched" do