Commit 1959fd1
committed
Preserve newlines in Markdown paragraph HTML output
The accept_paragraph method in ToHtml had a gsub that collapsed
newlines into spaces (or removed them for CJK text). This only
affected Markdown content since the RDoc markup parser already
converts newlines to spaces at parse time (parser.rb:221).
Remove the gsub so that Markdown soft breaks are preserved as
newlines in the HTML output, matching GFM behavior. For example,
`> foo\nbar` now produces `<p>foo\nbar</p>` instead of
`<p>foo bar</p>`.1 parent ce49b8b commit 1959fd1
File tree
3 files changed
+19
-37
lines changed- lib/rdoc/markup
- test/rdoc
- markup
3 files changed
+19
-37
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
313 | 313 | | |
314 | 314 | | |
315 | 315 | | |
316 | | - | |
317 | | - | |
318 | | - | |
319 | 316 | | |
320 | 317 | | |
321 | 318 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
236 | 236 | | |
237 | 237 | | |
238 | 238 | | |
239 | | - | |
| 239 | + | |
240 | 240 | | |
241 | 241 | | |
242 | 242 | | |
| |||
411 | 411 | | |
412 | 412 | | |
413 | 413 | | |
414 | | - | |
415 | | - | |
416 | | - | |
417 | | - | |
418 | | - | |
419 | | - | |
420 | | - | |
421 | | - | |
422 | | - | |
423 | | - | |
424 | | - | |
425 | | - | |
426 | | - | |
427 | | - | |
428 | | - | |
429 | | - | |
430 | | - | |
431 | | - | |
432 | | - | |
433 | | - | |
434 | | - | |
435 | | - | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
436 | 418 | | |
437 | | - | |
438 | | - | |
| 419 | + | |
| 420 | + | |
439 | 421 | | |
440 | 422 | | |
441 | 423 | | |
442 | | - | |
443 | | - | |
444 | | - | |
445 | | - | |
446 | | - | |
447 | | - | |
448 | | - | |
449 | | - | |
450 | | - | |
| 424 | + | |
451 | 425 | | |
452 | 426 | | |
453 | 427 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
78 | 89 | | |
79 | 90 | | |
80 | 91 | | |
| |||
0 commit comments