Skip to content

Commit

Permalink
Convert a backtick to an open single quote
Browse files Browse the repository at this point in the history
  • Loading branch information
nobu committed Sep 10, 2021
1 parent 09002bd commit 82eaefb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions lib/rdoc/text.rb
Expand Up @@ -240,6 +240,14 @@ def to_html text
when s.scan(/''/) then # tick double quote
html << encoded[:close_dquote]
after_word = nil
when s.scan(/`/) then # backtick
if insquotes or after_word
html << '`'
after_word = false
else
html << encoded[:open_squote]
insquotes = true
end
when s.scan(/&#39;|'/) then # single quote
if insquotes
html << encoded[:close_squote]
Expand Down
2 changes: 1 addition & 1 deletion test/rdoc/test_rdoc_markup_to_html.rb
Expand Up @@ -712,7 +712,7 @@ def test_convert_with_exclude_tag

def test_convert_underscore_adjacent_to_code
assert_equal "\n<p><code>aaa</code>_</p>\n", @to.convert(%q{+aaa+_})
assert_equal "\n<p>`<code>i386-mswin32_</code><em>MSRTVERSION</em>&#39;</p>\n", @to.convert(%q{`+i386-mswin32_+_MSRTVERSION_'})
assert_equal "\n<p>\u{2018}<code>i386-mswin32_</code><em>MSRTVERSION</em>\u{2019}</p>\n", @to.convert(%q{`+i386-mswin32_+_MSRTVERSION_'})
end

def test_gen_url
Expand Down

0 comments on commit 82eaefb

Please sign in to comment.