aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2023-12-02 21:24:11 +0900
committergit <svn-admin@ruby-lang.org>2023-12-02 12:40:12 +0000
commitc9c1670f7e7aaa17e69fd14d573f2f40ccd8a3da (patch)
treed90281a756661f429204f66a9e79464a6cee46c4
parent4ee1f0fb5de08acd659ec18409fca433d1bf371a (diff)
downloadruby-c9c1670f7e7aaa17e69fd14d573f2f40ccd8a3da.tar.gz
[ruby/rdoc] Markup punctuations need to be separated with a space
https://github.com/ruby/rdoc/commit/83f0149fc1
-rw-r--r--lib/rdoc/text.rb2
-rw-r--r--test/rdoc/test_rdoc_markup_to_html.rb14
2 files changed, 14 insertions, 2 deletions
diff --git a/lib/rdoc/text.rb b/lib/rdoc/text.rb
index 6f1a2b8d15..7c97c61ffd 100644
--- a/lib/rdoc/text.rb
+++ b/lib/rdoc/text.rb
@@ -313,6 +313,6 @@ module RDoc::Text
# Character class to be separated by a space when concatenating
# lines.
- SPACE_SEPARATED_LETTER_CLASS = /[\p{Nd}\p{Lc}\p{Pc}]/
+ SPACE_SEPARATED_LETTER_CLASS = /[\p{Nd}\p{Lc}\p{Pc}]|[!-~&&\W]/
end
diff --git a/test/rdoc/test_rdoc_markup_to_html.rb b/test/rdoc/test_rdoc_markup_to_html.rb
index 2dd8cf922d..e3affa533c 100644
--- a/test/rdoc/test_rdoc_markup_to_html.rb
+++ b/test/rdoc/test_rdoc_markup_to_html.rb
@@ -257,7 +257,7 @@ class TestRDocMarkupToHtml < RDoc::Markup::FormatterTestCase
end
def accept_paragraph_break
- assert_equal "\n<p>hello<br>world</p>\n", @to.res.join
+ assert_equal "\n<p>hello<br> world</p>\n", @to.res.join
end
def accept_paragraph_i
@@ -416,6 +416,18 @@ class TestRDocMarkupToHtml < RDoc::Markup::FormatterTestCase
@to.start_accepting
@to.accept_paragraph para("#{ohayo}\n", "#{sekai}\n")
assert_equal "\n<p>#{ohayo}#{sekai}</p>\n", @to.res.join
+
+ @to.start_accepting
+ @to.accept_paragraph para("+hello+\n", "world\n")
+ assert_equal "\n<p><code>hello</code> world</p>\n", @to.res.join
+
+ @to.start_accepting
+ @to.accept_paragraph para("hello\n", "+world+\n")
+ assert_equal "\n<p>hello <code>world</code></p>\n", @to.res.join
+
+ @to.start_accepting
+ @to.accept_paragraph para("+hello+\n", "+world+\n")
+ assert_equal "\n<p><code>hello</code> <code>world</code></p>\n", @to.res.join
end
def test_accept_heading_output_decoration