Skip to content

Commit 83f0149

Browse files
committed
Markup punctuations need to be separated with a space
1 parent 7696a57 commit 83f0149

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

lib/rdoc/text.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,6 @@ def wrap(txt, line_len = 76)
313313
# Character class to be separated by a space when concatenating
314314
# lines.
315315

316-
SPACE_SEPARATED_LETTER_CLASS = /[\p{Nd}\p{Lc}\p{Pc}]/
316+
SPACE_SEPARATED_LETTER_CLASS = /[\p{Nd}\p{Lc}\p{Pc}]|[!-~&&\W]/
317317

318318
end

test/rdoc/test_rdoc_markup_to_html.rb

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ def accept_paragraph_br
257257
end
258258

259259
def accept_paragraph_break
260-
assert_equal "\n<p>hello<br>world</p>\n", @to.res.join
260+
assert_equal "\n<p>hello<br> world</p>\n", @to.res.join
261261
end
262262

263263
def accept_paragraph_i
@@ -416,6 +416,18 @@ def test_accept_paragraph_newline
416416
@to.start_accepting
417417
@to.accept_paragraph para("#{ohayo}\n", "#{sekai}\n")
418418
assert_equal "\n<p>#{ohayo}#{sekai}</p>\n", @to.res.join
419+
420+
@to.start_accepting
421+
@to.accept_paragraph para("+hello+\n", "world\n")
422+
assert_equal "\n<p><code>hello</code> world</p>\n", @to.res.join
423+
424+
@to.start_accepting
425+
@to.accept_paragraph para("hello\n", "+world+\n")
426+
assert_equal "\n<p>hello <code>world</code></p>\n", @to.res.join
427+
428+
@to.start_accepting
429+
@to.accept_paragraph para("+hello+\n", "+world+\n")
430+
assert_equal "\n<p><code>hello</code> <code>world</code></p>\n", @to.res.join
419431
end
420432

421433
def test_accept_heading_output_decoration

0 commit comments

Comments
 (0)