@@ -56,7 +56,7 @@ def test_parse_block_quote
5656 expected =
5757 doc (
5858 block (
59- para ( "this is\n a block quote" ) ) )
59+ para ( "this is" , hard_break , "a block quote") ) )
6060
6161 assert_equal expected , doc
6262 end
@@ -70,11 +70,22 @@ def test_parse_block_quote_continue
7070 expected =
7171 doc (
7272 block (
73- para ( "this is\n a block quote" ) ) )
73+ para ( "this is" , hard_break , "a block quote") ) )
7474
7575 assert_equal expected , doc
7676 end
7777
78+ def test_parse_block_quote_continue_html
79+ doc = parse <<-BLOCK_QUOTE
80+ > this is
81+ a block quote
82+ BLOCK_QUOTE
83+
84+ html = doc . accept ( RDoc ::Markup ::ToHtml . new )
85+
86+ assert_include html , "<p>this is<br>\n a block quote</p>"
87+ end
88+
7889 def test_parse_block_quote_list
7990 doc = parse <<-BLOCK_QUOTE
8091> text
@@ -104,7 +115,7 @@ def test_parse_block_quote_newline
104115 expected =
105116 doc (
106117 block (
107- para ( "this is\n a block quote" ) ) )
118+ para ( "this is" , hard_break , "a block quote") ) )
108119
109120 assert_equal expected , doc
110121 end
@@ -120,7 +131,7 @@ def test_parse_block_quote_separate
120131 expected =
121132 doc (
122133 block (
123- para ( "this is\n a block quote" ) ,
134+ para ( "this is" , hard_break , "a block quote") ,
124135 para ( "that continues" ) ) )
125136
126137 assert_equal expected , doc
@@ -262,7 +273,7 @@ def test_parse_code_github
262273 assert_equal expected , parse ( doc )
263274
264275 expected =
265- doc ( para ( "Example:\n <code>\n " "code goes here\n </code>" ) )
276+ doc ( para ( "Example:" , hard_break , " <code>\n ""code goes here\n </code>" ) )
266277
267278 assert_equal expected , parse ( doc . sub ( /^\n / , '' ) )
268279 end
@@ -296,7 +307,7 @@ def test_parse_code_github_format
296307 assert_equal expected , parse ( doc )
297308
298309 expected =
299- doc ( para ( "Example:\n <code>ruby\n " "code goes here\n </code>" ) )
310+ doc ( para ( "Example:" , hard_break , " <code>ruby\n ""code goes here\n </code>" ) )
300311
301312 assert_equal expected , parse ( doc . sub ( /^\n / , '' ) )
302313 end
@@ -343,7 +354,7 @@ def test_parse_definition_list_indents
343354 item ( %w[ one ] , para ( "Indented one characters" ) ) ,
344355 item ( %w[ two ] , para ( "Indented two characters" ) ) ,
345356 item ( %w[ three ] , para ( "Indented three characters" ) ) ) ,
346- para ( "four\n : Indented four characters" ) )
357+ para ( "four" , hard_break , " : Indented four characters") )
347358
348359 assert_equal expected , doc
349360 end
@@ -392,9 +403,9 @@ def test_parse_definition_list_multi_line
392403 expected = doc (
393404 list ( :NOTE ,
394405 item ( %w[ one ] ,
395- para ( "This is a definition\n that extends to two lines" ) ) ,
406+ para ( "This is a definition" , hard_break , "that extends to two lines") ) ,
396407 item ( %w[ two ] ,
397- para ( "This is another definition\n that also extends to two lines" ) ) ) )
408+ para ( "This is another definition" , hard_break , "that also extends to two lines") ) ) )
398409
399410 assert_equal expected , doc
400411 end
@@ -430,8 +441,8 @@ def test_parse_definition_list_no
430441 MD
431442
432443 expected = doc (
433- para ( "one\n : This is a definition" ) ,
434- para ( "two\n : This is another definition" ) )
444+ para ( "one" , hard_break , " : This is a definition") ,
445+ para ( "two" , hard_break , " : This is another definition") )
435446
436447 assert_equal expected , doc
437448 end
@@ -779,7 +790,7 @@ def test_parse_list_bullet_multiline
779790
780791 expected = doc (
781792 list ( :BULLET ,
782- item ( nil , para ( "one\n two" ) ) ) )
793+ item ( nil , para ( "one" , hard_break , " two") ) ) )
783794
784795 assert_equal expected , doc
785796 end
@@ -832,7 +843,7 @@ def test_parse_list_bullet_nest_continue
832843 para ( "outer" ) ,
833844 list ( :BULLET ,
834845 item ( nil ,
835- para ( "inner\n continue inner" ) ) ) ) ,
846+ para ( "inner" , hard_break , " continue inner") ) ) ) ,
836847 item ( nil ,
837848 para ( "outer 2" ) ) ) )
838849
@@ -899,7 +910,7 @@ def test_parse_note_indent
899910 expected = doc (
900911 para ( "Some text.{*1}[rdoc-label:foottext-1:footmark-1]" ) ,
901912 rule ( 1 ) ,
902- para ( "{^1}[rdoc-label:footmark-1:foottext-1] With a footnote\n \n more " ) )
913+ para ( "{^1}[rdoc-label:footmark-1:foottext-1] With a footnote" , hard_break , "more ") )
903914
904915 assert_equal expected , doc
905916 end
@@ -940,8 +951,10 @@ def test_parse_note_multiple
940951 MD
941952
942953 expected = doc (
943- para ( "Some text{*1}[rdoc-label:foottext-1:footmark-1]\n " +
944- "with inline notes{*2}[rdoc-label:foottext-2:footmark-2]\n " +
954+ para ( "Some text{*1}[rdoc-label:foottext-1:footmark-1]" ,
955+ hard_break ,
956+ "with inline notes{*2}[rdoc-label:foottext-2:footmark-2]" ,
957+ hard_break ,
945958 "and an extra note.{*3}[rdoc-label:foottext-3:footmark-3]" ) ,
946959
947960 rule ( 1 ) ,
@@ -1040,7 +1053,7 @@ def test_parse_paragraph_indent_three
10401053 def test_parse_paragraph_multiline
10411054 doc = parse "one\n two"
10421055
1043- expected = doc ( para ( "one\n two " ) )
1056+ expected = doc ( para ( "one" , hard_break , "two ") )
10441057
10451058 assert_equal expected , doc
10461059 end
@@ -1444,7 +1457,7 @@ def test_info_string_css_classes
14441457 def test_lazy_continuation_in_blockquote
14451458 html = render ( "> Foo\n Bar\n " )
14461459 assert_match ( %r{<blockquote>.*Foo.*Bar.*</blockquote>}m , html )
1447- assert_match ( %r{Foo Bar } , html )
1460+ assert_match ( %r{Foo<br> \n Bar } , html )
14481461 end
14491462
14501463 def test_ordered_list_paren_delimiter_not_supported
@@ -1483,8 +1496,12 @@ def test_autolinks
14831496 end
14841497
14851498 def test_backslash_line_break_not_supported
1499+ # Backslash line break syntax (\<newline>) is not specifically supported,
1500+ # but break_on_newline converts all newlines to <br>, so <br> is present.
1501+ # The backslash itself appears literally in the output.
14861502 html = render ( "Line one\\ \n Line two\n " )
1487- assert_not_match ( %r{<br>} , html )
1503+ assert_match ( %r{<br>} , html )
1504+ assert_match ( %r{Line one\\ } , html )
14881505 end
14891506
14901507 def test_escape_tilde_not_supported
0 commit comments