From 3bca7dc093c7e76a4d7b609d4ea6272c6829e1a6 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Fri, 10 Sep 2021 23:25:02 +0900 Subject: [PATCH] Convert upper case copyright and registered marks --- lib/rdoc/text.rb | 4 ++-- test/rdoc/test_rdoc_text.rb | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/rdoc/text.rb b/lib/rdoc/text.rb index c3218fdb2f..7d99511eb0 100644 --- a/lib/rdoc/text.rb +++ b/lib/rdoc/text.rb @@ -218,10 +218,10 @@ def to_html text when s.scan(/\.\.\.(\.?)/) then html << s[1] << encoded[:ellipsis] after_word = nil - when s.scan(/\(c\)/) then + when s.scan(/\(c\)/i) then html << encoded[:copyright] after_word = nil - when s.scan(/\(r\)/) then + when s.scan(/\(r\)/i) then html << encoded[:trademark] after_word = nil when s.scan(/---/) then diff --git a/test/rdoc/test_rdoc_text.rb b/test/rdoc/test_rdoc_text.rb index 59d63b29bd..ac89cb161d 100644 --- a/test/rdoc/test_rdoc_text.rb +++ b/test/rdoc/test_rdoc_text.rb @@ -495,6 +495,7 @@ def test_to_html_br def test_to_html_copyright assert_equal '©', to_html('(c)') + assert_equal '©', to_html('(C)') end def test_to_html_dash @@ -549,6 +550,7 @@ def test_to_html_html_tag def test_to_html_registered_trademark assert_equal '®', to_html('(r)') + assert_equal '®', to_html('(R)') end def test_to_html_tt_tag