Skip to content

Commit 17266ad

Browse files
committed
Output proper HTML markup for markdown input
RDoc formatters process inline markup on a paragraph-by-paragraph basis. If this is not done then embedded markup in that paragraph will not be output correctly. Now the paragraph's contents are joined into a single line before processing which allows the formatter to generate the correct output. Fixes #204
1 parent 6b194cc commit 17266ad

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

History.rdoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
* `rdoc --pipe` output now contains <code></code> for markdown compliance.
2121
* RDoc no longer leaves emacs-style modelines in .txt, .md or .rd files.
2222
Bug #178 by Zachary Scott
23+
* RDoc no longer puts raw markup in HTML output for markdown input. Bug
24+
#204 by Erik Hollensbe
2325

2426
=== 4.0.0 / 2013-02-24
2527

lib/rdoc/markup/paragraph.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def text hard_break = ''
2121
else
2222
part
2323
end
24-
end.join
24+
end.join.gsub(/\r?\n/, ' ')
2525
end
2626

2727
end

test/test_rdoc_markup_to_html.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ def accept_paragraph_br
256256
end
257257

258258
def accept_paragraph_break
259-
assert_equal "\n<p>hello<br>\nworld</p>\n", @to.res.join
259+
assert_equal "\n<p>hello<br> world</p>\n", @to.res.join
260260
end
261261

262262
def accept_paragraph_i

0 commit comments

Comments
 (0)