-
Notifications
You must be signed in to change notification settings - Fork 455
Enable break_on_newline extension by default for Markdown #1628
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -313,9 +313,6 @@ def accept_block_quote(block_quote) | |
| def accept_paragraph(paragraph) | ||
| @res << "\n<p>" | ||
| text = paragraph.text @hard_break | ||
| text = text.gsub(/(#{SPACE_SEPARATED_LETTER_CLASS})?\K\r?\n(?=(?(1)(#{SPACE_SEPARATED_LETTER_CLASS})?))/o) { | ||
| defined?($2) && ' ' | ||
| } | ||
| @res << to_html(text) | ||
| @res << "</p>\n" | ||
|
Comment on lines
313
to
317
|
||
| end | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -236,7 +236,7 @@ def accept_paragraph_br | |||||
| end | ||||||
|
|
||||||
| def accept_paragraph_break | ||||||
| assert_equal "\n<p>hello<br> world</p>\n", @to.res.join | ||||||
| assert_equal "\n<p>hello<br>\nworld</p>\n", @to.res.join | ||||||
| end | ||||||
|
|
||||||
| def accept_paragraph_i | ||||||
|
|
@@ -411,43 +411,13 @@ def test_accept_heading_dedup_resets_on_start_accepting | |||||
| end | ||||||
|
|
||||||
| def test_accept_paragraph_newline | ||||||
| hellos = ["hello", "\u{393 3b5 3b9 3ac} \u{3c3 3bf 3c5}"] | ||||||
| worlds = ["world", "\u{3ba 3cc 3c3 3bc 3bf 3c2}"] | ||||||
| ohayo, sekai = %W"\u{304a 306f 3088 3046} \u{4e16 754c}" | ||||||
|
|
||||||
| hellos.product(worlds) do |hello, world| | ||||||
| @to.start_accepting | ||||||
| @to.accept_paragraph para("#{hello}\n", "#{world}\n") | ||||||
| assert_equal "\n<p>#{hello} #{world}</p>\n", @to.res.join | ||||||
| end | ||||||
|
|
||||||
| hellos.each do |hello| | ||||||
| @to.start_accepting | ||||||
| @to.accept_paragraph para("#{hello}\n", "#{sekai}\n") | ||||||
| assert_equal "\n<p>#{hello}#{sekai}</p>\n", @to.res.join | ||||||
| end | ||||||
|
|
||||||
| worlds.each do |world| | ||||||
| @to.start_accepting | ||||||
| @to.accept_paragraph para("#{ohayo}\n", "#{world}\n") | ||||||
| assert_equal "\n<p>#{ohayo}#{world}</p>\n", @to.res.join | ||||||
| end | ||||||
|
|
||||||
| @to.start_accepting | ||||||
| @to.accept_paragraph para("#{ohayo}\n", "#{sekai}\n") | ||||||
| assert_equal "\n<p>#{ohayo}#{sekai}</p>\n", @to.res.join | ||||||
| @to.accept_paragraph para("hello\n", "world\n") | ||||||
| assert_equal "\n<p>hello\nworld\n</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 | ||||||
| assert_equal "\n<p><code>hello</code>\nworld\n</p>\n", @to.res.join | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this intentional?
Suggested change
|
||||||
| end | ||||||
|
|
||||||
| def test_accept_heading_output_decoration | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR description claims this change matches GFM rendering for soft line breaks, but this table row states the opposite (GFM renders soft breaks as a space). Please reconcile the PR description with the documented behavior here to avoid confusion about whether this is intended divergence from GFM.