atom / markdown-preview

πŸ“ Markdown preview in Atom
MIT License
1.23k stars 357 forks source link

Absence of line between a list and a code block confuses Markdown Preview #572

Closed piroux closed 4 years ago

piroux commented 4 years ago

Prerequisites

Description

The parser of markdown-preview seems to not recognize well the delimiter of a code block written directly after a list without any empty line, although it is properly handled on Github. Actually, it seems like markdown-preview is trying to embed the code block at the list level but fail to recognize the end of the code block, whereas Github rendering makes the choice to render all code block outside of the list level.

Steps to Reproduce

  1. Write the following gist in a new tab: https://gist.github.com/piroux/0caf3509cd000e254dab357025c9faf1
  2. CTRL+SHIFT+M to activate the vanilla Markown Preview

Edit by @rsese - for step 1, copy paste this content

## βœ… on github.com βœ… on Atom with no line between a list and a code block

- abcd

```
efgh
---
- xyz
  123
```

## βœ… on github.com ❌ on Atom with no line between a list and a code block

- abcd
```
efgh
---
- xyz
  123
```

Expected behavior:

Preview on Atom should match the one offered by Github: Screenshot from 2019-08-23 10-10-56

Actual behavior:

Screenshot from 2019-08-23 10-13-23

Reproduces how often: Always

Versions

OS: Ubuntu 18.04 x64 Atom: 1.40.0 Electron: 3.1.10 Chrome: 66.0.3359.181 Node: v10.2.0

Additional Information

Other issues related to code preview already filed here:

rsese commented 4 years ago

Thanks for the report! Reproduced with 1.42.0-nightly4 on 10.14.6.

rsese commented 4 years ago

Thanks again for the heads up about this - just wanted to mention that we looked at this again today and decided to close in favor of https://github.com/atom/markdown-preview/issues/342 if you want to subscribe there.