[ruby/rdoc] Markup punctuations need to be separated with a space

https://github.com/ruby/rdoc/commit/83f0149fc1
This commit is contained in:
Nobuyoshi Nakada 2023-12-02 21:24:11 +09:00 committed by git
parent 4ee1f0fb5d
commit c9c1670f7e
2 changed files with 14 additions and 2 deletions

View File

@ -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

View File

@ -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