JetBrains / markdown

Markdown parser written in kotlin
Apache License 2.0
706 stars 78 forks source link

put CodeFenceProvider before SetextHeaderProvider #35

Closed vladimir-koshelev closed 5 years ago

vladimir-koshelev commented 5 years ago

Code fragments like:

```
---

could be processed by both CodeFence and SetextHeader providers.

But according to the common sense and markdown-it parser it should be parsed as CodeFence. A real world example is

 ```yaml
 ---
 # A list of tasty fruits
 - Apple
 - Orange
 - Strawberry
 - Mango
 ---
 # A list of tasty fruits
 - Apple
 - Orange
 - Strawberry
 - Mango
 ```

If it's parsed as SetextHeader, the rest of a markdown document will be broken.

IDEA-218203

vladimir-koshelev commented 5 years ago

the reference implementation of a markdown parser works in such a way as well: https://spec.commonmark.org/dingus/?text=%60%60%60yaml%0A---%0A%60%60%60

valich commented 5 years ago

Merged, thanks!