diff --git a/lib/rdoc/text.rb b/lib/rdoc/text.rb index 2fc47daa66..77318e46e4 100644 --- a/lib/rdoc/text.rb +++ b/lib/rdoc/text.rb @@ -240,6 +240,14 @@ module RDoc::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(/'|'/) then # single quote if insquotes html << encoded[:close_squote] diff --git a/test/rdoc/test_rdoc_markup_to_html.rb b/test/rdoc/test_rdoc_markup_to_html.rb index 342cf71082..b2b21de806 100644 --- a/test/rdoc/test_rdoc_markup_to_html.rb +++ b/test/rdoc/test_rdoc_markup_to_html.rb @@ -712,7 +712,7 @@ EXPECTED def test_convert_underscore_adjacent_to_code assert_equal "\n
aaa
_
`i386-mswin32_
MSRTVERSION'
\u{2018}i386-mswin32_
MSRTVERSION\u{2019}