Skip to content

Commit

Permalink
Replace apostrophe with right single quote to avoid markdown interpre…
Browse files Browse the repository at this point in the history
…tation as issue 39.
  • Loading branch information
maxlazio committed Oct 9, 2014
1 parent 099cf35 commit 64e72af
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions lib/redcarpet/render/gitlab_html.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ def initialize(template, options = {})
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:
Expand Down
4 changes: 2 additions & 2 deletions spec/helpers/gitlab_markdown_helper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ def url_helper(image_name)
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

Expand Down Expand Up @@ -566,7 +566,7 @@ def url_helper(image_name)

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>Dont use <code>$#{snippet.id}</code> here.</p>\n"
end

it "should leave ref-like autolinks untouched" do
Expand Down

0 comments on commit 64e72af

Please sign in to comment.