vmg / sundown

Standards compliant, fast, secure markdown processing library in C
1.99k stars 385 forks source link

injected h1 html #2

Closed MartinMa closed 13 years ago

MartinMa commented 13 years ago

I hope this is the right place to report markdown rendering issues on here.

The issue can be seen here https://github.com/paulirish/html5-boilerplate/issues/378#issuecomment-894943 Unless I have done something terribly wrong, I'd say this is a bug. It worked before the change!

It is supposed to show a block of html code (in a code block) followed by some text and two hyperlinks. It does, however, show some weird cropped mix-up of the code, followed by a real proper styled h1-tag with text in it, which was actually part code to appear in said code block (Non-blocking downloads in IE8).

Thoughts?

vmg commented 13 years ago

Hey, can you actually post the raw Markdown you inputted originally? Cheers.

MartinMa commented 13 years ago

Sure, I uploaded it as a text file here https://gist.github.com/930908

I think one problem is that I didn't put a "fence" (empty line) before and after the code? Is this a necessity? I couldn't find a clue over at the markdown guide github refers to http://daringfireball.net/projects/markdown/syntax . Oddly enough it worked before the engine switch.

Apart from that, the resultant text shouldn't be that distorted right?

vmg commented 13 years ago

Hey, our new parser is more strict when it comes to the Markdown standard. All block elements (specially code blocks) are supposed to be separated with one blank line from the preceding paragraph (check the MD docs). Sorry if this is an inconvenience, but it's always a good thing sticking to the standards, specially when these make parsing easier & more efficient; the behavior of our previous parser was, in fact, a bug. This new parser has the same behavior as the official Markdown.pl parser, which is embedding all that as actual inline HTML -- the resulting distorted text is to be expected.

MartinMa commented 13 years ago

Okay, thanks for the explanation. That makes sense.

Unfortunately, "the Markdown Guide" is misleading in that matter. I doesn't mention the need for blank lines. Even worse, it says A code block continues until it reaches a line that is not indented (or the end of the article).

I'm guessing you have nothing to do with that guide but it is a problem because github generally refers too it (blogs, wiki).