Skip to content

Keep blank lines in backtick code block on blockquote (fix #3769)#3770

Merged
curbengh merged 1 commit intohexojs:masterfrom
seaoak:bugfix/keep_blank_lines_in_backtick_code_block_on_blockquote
Nov 2, 2019
Merged

Keep blank lines in backtick code block on blockquote (fix #3769)#3770
curbengh merged 1 commit intohexojs:masterfrom
seaoak:bugfix/keep_blank_lines_in_backtick_code_block_on_blockquote

Conversation

@seaoak
Copy link
Member

@seaoak seaoak commented Oct 16, 2019

What does it do?

fix #3769

Blank lines in backtick code block on blockquote should be kept.
But backtick_code_block.js removes them.
This patch fixes this behavior.

This bug is introduced by the PR #3765

How to test

npm test

Pull request tasks

  • Add test cases for the changes.
  • Passed the CI test.

Blank lines in backtick code block on blockquote should be kept.
But `backtick_code_block.js` removes them.
This patch fixes this behavior.
This bug is introduced by the PR hexojs#3765
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.0008%) to 97.282% when pulling 6c1bfcc on seaoak:bugfix/keep_blank_lines_in_backtick_code_block_on_blockquote into 9662366 on hexojs:master.

@seaoak seaoak requested review from a team and curbengh October 16, 2019 02:24
@curbengh
Copy link
Contributor

curbengh commented Oct 16, 2019

I appreciate the effort, my apology if my comment was misunderstood, I intended it to the Markdown beginners.

The reason being this PR is not consistent with GFM, which also doesn't keep blank lines; i.e. <br/> is required to add new lines. I personally prefer to be consistent with GFM. I'm guessing there might be instance where user add a blank line > simply for readability (of the source md file), but doesn't actually want new line.

Following is demo of GFM behavior:

> This is a code-block
> 
> ```json
> {
>   "test": 123
> }
> ```
>
>
> This is a following paragraph

rendered as,

This is a code-block

{
  "test": 123
}

This is a following paragraph


> This is a code-block
> 
> ```json
> {
>   "test": 123
> }
> ```
> <br/>
> <br/>
> This is a following paragraph

rendered as

This is a code-block

{
  "test": 123
}


This is a following paragraph

I tested the previous PR #3768, it is consistent with GFM.

@seaoak
Copy link
Member Author

seaoak commented Oct 16, 2019

@curbengh My understanding that blank lines out of a code block are meaningless in GFM.
This PR is for a blank line IN a code block.

I think a blank line in a code block shuold be kept even if it is in blockquote.

For example, the followings contains two blank line
and I can preview them as it is.

aaa


bbb

@curbengh
Copy link
Contributor

This PR is for a blank line IN a code block.

aaa


bbb

The example makes it clearer to me. I just tested this PR, now it's more consistent with GFM.

@curbengh curbengh requested a review from a team October 17, 2019 06:32
@seaoak
Copy link
Member Author

seaoak commented Oct 17, 2019

@curbengh Thank you to review and test! 😄
Your comments are very helpful to clarify this PR and my understanding.

@curbengh curbengh added this to the v4.1.0 milestone Oct 20, 2019
@curbengh curbengh requested review from a team and removed request for a team October 28, 2019 09:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Blank lines in backtick code block on blockquote are removed

4 participants