Skip to content

Blank lines in backtick code block on blockquote are removed #3769

@seaoak

Description

@seaoak

Check List

Please check followings before submitting a new issue.

  • I have already read Docs page & Troubleshooting page
  • I have already searched existing issues and they are not help to me
  • I examined error or warning messages and it's difficult to solve
  • Node.js is higher than 6.9

Expected behavior

Blank lines in backtick code block on blockquote should be kept.
But backtick_code_block.js removes them.

For example,

> This is a code-block
> 
> > ```
> >
> >
> >
> {
>   "test": 123
>
> }
>
> ```
> 
> This is the last line

should be rendered to:

<blockquote>
<p>This is a code-block</p>
<blockquote>
<pre><code>



{
  &quot;test&quot;: 123

}

</code></pre>
</blockquote>
<p>This is the last line</p>
</blockquote>

Actual behavior

Blank lines are removed:

<blockquote>
<p>This is a code-block</p>
<blockquote>
<pre><code>
{
  &quot;test&quot;: 123
}
</code></pre>
</blockquote>
<p>This is the last line</p>
</blockquote>

Environment & Settings

  • Node.js v8.16.2 (npm v6.4.1)
  • Node.js v10.16.3 (npm v6.9.0)
  • Node.js v12.11.1 (npm v6.11.3)

Others

This bug is introduced by the PR #3765

I already have a patch for this issue.
I'll make a PR soon.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions