Skip to content
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

Disable to insert extra new line character into the end of backtick code block (fix #3767) #3768

Conversation

@seaoak
Copy link
Member

@seaoak seaoak commented Oct 15, 2019

What does it do?

Fix #3767

A paragraph follows a backtick code block on a blockquote should be included same blcokquote block.
But the code block always terminates blockquote.
So the blockquote block splits two blocks.

This is caused by the implementation of backtick_code_block.js.
It inserts extra new line character into the end of backtick code block.

This patch disables this behavior.

How to test

$ npm test

Pull request tasks

  • Add test cases for the changes.
  • Passed the CI test.
…ode block (fix hexojs#3767)

A paragraph follows a backtick code block on a blockquote should be included same blcokquote block.
But the code block always terminates blockquote.
So the blockquote block splits two blocks.

This is caused by the implementation of `backtick_code_block.js`.
It inserts extra new line character into the end of backtick code block.

This patch disables this behavior.
@seaoak seaoak requested a review from Oct 15, 2019
@coveralls
Copy link

@coveralls coveralls commented Oct 15, 2019

Coverage Status

Coverage remained the same at 97.283% when pulling 84c4c66 on seaoak:bugfix/backtick_code_block_on_blockquote_always_terminates_the_blockquote_block into 6b329e9 on hexojs:master.

@curbengh
Copy link
Contributor

@curbengh curbengh commented Oct 16, 2019

Using your example:

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

a note for anyone's new to Markdown is that, the "following paragraph" is displayed immediately after the codeblock (no newline), regardless of how many > are there. another example,

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

The above wouldn't have new lines either.

This is not a limitation of this PR (nor #3765), the behavior is rather expected for Markdown; I figure it could be rather unexpected for those who are new to Markdown.

PS:

>
>
> no new lines
>
>

would be displayed as:

no new lines

not



no new lines


@curbengh curbengh merged commit ac03b72 into hexojs:master Oct 16, 2019
4 checks passed
@curbengh curbengh added this to In progress in v4.0.0 via automation Oct 16, 2019
@curbengh curbengh moved this from In progress to Done in v4.0.0 Oct 16, 2019
@curbengh curbengh added this to the v4.0.0 milestone Oct 16, 2019
@seaoak
Copy link
Member Author

@seaoak seaoak commented Oct 16, 2019

@curbengh Thank you for review and advice!
Your advice is very helpful in making new patch for a bug of PR #3765

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
v4.0.0
  
Done
Linked issues

Successfully merging this pull request may close these issues.

3 participants