Replace apostrophe with right single quote to avoid markdown interpretation as issue 39.
This commit is contained in:
parent
099cf3558f
commit
64e72af3cb
2 changed files with 7 additions and 2 deletions
|
@ -10,6 +10,11 @@ class Redcarpet::Render::GitlabHTML < Redcarpet::Render::HTML
|
|||
super options
|
||||
end
|
||||
|
||||
def normal_text(text)
|
||||
return text unless text.present?
|
||||
text.gsub("'", "’")
|
||||
end
|
||||
|
||||
def block_code(code, language)
|
||||
# New lines are placed to fix an rendering issue
|
||||
# with code wrapped inside <h1> tag for next case:
|
||||
|
|
|
@ -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 <a.+>@#{member.user.username}<\/a>'s task/
|
||||
expected = /Yes, it is <a.+>@#{member.user.username}<\/a>’s task/
|
||||
markdown(actual).should match(expected)
|
||||
end
|
||||
|
||||
|
@ -566,7 +566,7 @@ describe GitlabMarkdownHelper do
|
|||
|
||||
it "should leave inline code untouched" do
|
||||
markdown("\nDon't use `$#{snippet.id}` here.\n").should ==
|
||||
"<p>Don't use <code>$#{snippet.id}</code> here.</p>\n"
|
||||
"<p>Don’t use <code>$#{snippet.id}</code> here.</p>\n"
|
||||
end
|
||||
|
||||
it "should leave ref-like autolinks untouched" do
|
||||
|
|
Loading…
Reference in a new issue