marked icon indicating copy to clipboard operation
marked copied to clipboard

How to turn on CommonMark

Open daggett206 opened this issue 8 years ago • 3 comments

There is nothing in the documentation about how to switch on the CommonMark parser. How to do that? Here is my markdown

<div class="something" markdown="1" dir>

 ## Heading 2
 Some **bold** text.

</div>

so, here is it doesn't work at all, but here with CommonMark it works correctly

Thanks in advance!

daggett206 avatar May 11 '18 11:05 daggett206

Looks like there are two things at play here. To the first question, there is not, at this time, an explicit way to say "CommonMark" - it is under consideration. Having said that, the temporary logic is to explicitly set Pedantic and GFM to false.

I can confirm this does not seem to work. However, I can also confirm that CommonMark Example 120 does work here. It seems to be the inclusion of the header.

Maybe you can help us resolve by submitting a PR?

joshbruce avatar May 11 '18 13:05 joshbruce

This also seems to be related to #1263 since both are wrapping in html tags.

styfle avatar May 13 '18 19:05 styfle

To add to @joshbruce answer, you must disable heading ids since those are enabled by default. Related issue to change default options: #1280

The output for marked is identical (in this case) to commonmark if you set headerIds: false.

See the USING_ADVANCED doc for more options.

I'll close this issue since this particular markdown renders properly now.

styfle avatar Aug 17 '18 14:08 styfle