Skip to content

Two blank lines within a fenced code block terminates ordered list and breaks code block #1316

@epbarger

Description

@epbarger

Subject of the issue

Fenced code blocks within a number bullet point break if they contain more one new-line in a row.

Your environment

  • OS: macOS Mojave 10.14.4
  • Packages: @mdx-js/mdx@1.6.4, via "gatsby-plugin-mdx": "^1.2.6"
  • Env: yarn 1.22.4, gatsby 2.23.1

Steps to reproduce

Nest a fenced code block under a number bullet point, with two blank lines in a row within the code block. One blank line does not cause this issue.

1. Test
   ```
   broken


   example
   ```

Plain text after the numbered bullet point

Expected behaviour

I would expect this to work fine, parsing the code block correctly and keeping the entire block nested under the numbered bullet point.

Actual behaviour

The second new line appears to cause the parser to end the bullet point, breaking the code block. The ending triple backticks will then start a new code block, causing chaos with the rest of the page

Screen Shot 2020-10-29 at 3 41 01 PM

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions