atom / language-gfm

GitHub Flavored Markdown in Atom
MIT License
101 stars 114 forks source link

Fail to tag ### Headers inside list #100

Open v3ss0n opened 9 years ago

v3ss0n commented 9 years ago
## Activities

- List of Events those are public
- ### Filtering

fail-to-tag

v3ss0n commented 9 years ago

same goes for all other markdown syntaxes , they are not highlighted inside lists

lee-dohm commented 9 years ago

I don't believe this is a bug. If you look at the original Markdown specification for headers, it specifically states that ATX-style headers, i.e. the ones that start with hash marks, "use 1-6 hash characters at the start of the line" (emphasis added).

Also, for example:

:point_up: isn't a header. Whereas:

:point_up: is a header that is contained within a list.

This is the issue with Markdown and the reason why the CommonMark project was started. Markdown is not rigorously specified, so edge cases like these are up for interpretation.

v3ss0n commented 9 years ago

Ah i c , that was not supported in old markdown ? But the renderer , renders it so i thought it was a bug in syntax highlight.

lee-dohm commented 9 years ago

The original Markdown is awesome for what it was originally designed for, taking simple conventions patterned after email conversations and turning them into simple HTML documents. It wasn't designed for all the various complex documents that people are trying to use it for ten years later :smile:

And Atom's Markdown flavor is GitHub-flavored Markdown. You can find various references for it in the GitHub Help documentation like Mastering Markdown. If you stick to the formatting that the examples directly show, then things will render as expected. If you wander off into the edge cases, then the various Markdown parsers start to disagree.

For some background, see Jeff Atwood's blog post announcing Standard-Flavored Markdown, renamed later to CommonMark. For example:

Just for that, I count fifteen different rendered outputs from 22 different Markdown parsers.