foundation / panini

A super simple flat file generator.
Other
592 stars 104 forks source link

Markdown parser acting funky with raw html #175

Closed EtanTheTartan closed 5 years ago

EtanTheTartan commented 5 years ago

Since I see that the markdown renderer is referenced within Panini, I decided to open the issue here, but feel free to tell me I'm wrong here.

I have a markdown file. I went from doing an <h2> as ## to using raw html. IE, I went from this:

##Our Rules
Effective: April 2, 2015

To:

<h2>Our Rules</h2>
Effective: April 2, 2015

The very strange thing here is that, when there's no line break in the raw <html>, the 2nd option, the markdown doesn't render! Anything subsequent render as a string literal and not as the intended markdown -> tag.

simply adding a line break between <h2>Our Rules</h2> and Effective: April 2, 2015 fixed it. As so:

<h2>Our Rules</h2>

Effective: April 2, 2015
gakimball commented 5 years ago

Markdown parsing in Panini is handled by the marked library.

It's possible the behavior you're describing here is intentional on the part of marked's authors, but it's hard to say. There's no official Markdown spec, so every library does it a little different, resulting in weird edge cases like this.

EtanTheTartan commented 5 years ago

@gakimball fyi, it could be that you're using an older version of marked: https://github.com/markedjs/marked/issues/1370#issuecomment-434696558

Or some other issue with panini?