diff options
-rw-r--r-- | lib/rdoc/text.rb | 2 | ||||
-rw-r--r-- | test/rdoc/test_rdoc_text.rb | 7 |
2 files changed, 8 insertions, 1 deletions
diff --git a/lib/rdoc/text.rb b/lib/rdoc/text.rb index c3218fdb2f..2fc47daa66 100644 --- a/lib/rdoc/text.rb +++ b/lib/rdoc/text.rb @@ -240,7 +240,7 @@ module RDoc::Text when s.scan(/''/) then # tick double quote html << encoded[:close_dquote] after_word = nil - when s.scan(/'/) then # single quote + when s.scan(/'|'/) then # single quote if insquotes html << encoded[:close_squote] insquotes = false diff --git a/test/rdoc/test_rdoc_text.rb b/test/rdoc/test_rdoc_text.rb index 59d63b29bd..02c56a2829 100644 --- a/test/rdoc/test_rdoc_text.rb +++ b/test/rdoc/test_rdoc_text.rb @@ -485,6 +485,13 @@ The comments associated with assert_equal '‘a’ ‘', to_html("'a' '") end + def test_to_html_apostrophe_entity + assert_equal '‘a', to_html("'a") + assert_equal 'a’', to_html("a'") + + assert_equal '‘a’ ‘', to_html("'a' '") + end + def test_to_html_backslash assert_equal 'S', to_html('\\S') end |