[ruby/rdoc] Convert a backtick to an open single quote

https://github.com/ruby/rdoc/commit/82eaefbae4
This commit is contained in:
Nobuyoshi Nakada 2021-08-28 12:57:36 +09:00 коммит произвёл git
Родитель c5c0f5c652
Коммит 6944163415
2 изменённых файлов: 9 добавлений и 1 удалений

Просмотреть файл

@ -240,6 +240,14 @@ module RDoc::Text
when s.scan(/''/) then # tick double quote when s.scan(/''/) then # tick double quote
html << encoded[:close_dquote] html << encoded[:close_dquote]
after_word = nil 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 when s.scan(/&#39;|'/) then # single quote
if insquotes if insquotes
html << encoded[:close_squote] html << encoded[:close_squote]

Просмотреть файл

@ -712,7 +712,7 @@ EXPECTED
def test_convert_underscore_adjacent_to_code 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>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 end
def test_gen_url def test_gen_url