evilstreak / markdown-js

A Markdown parser for javascript
7.69k stars 863 forks source link

FIX: HTML blocks should not be surrounded by `<p>` #139

Closed eviltrout closed 10 years ago

eviltrout commented 10 years ago

Part of the Markdown spec specifies that if html tags are present in their own block they should not be surrounded by paragraphs. This patch checks to see if a block begins with an HTML tag before surrounding it in a paragraph.

A secondary part changes the debugging method to not complain if the JsonML fragment that comes back is a string. I suppose previously everything had a tag around it!

ashb commented 10 years ago

This is a much bigger issue than this looks at first and there are 3 other pull requests that deal with inline HTML: #98, #87, #34 (and an issue #16)

Also There's things like if the element starts with a block level HTML element then markdown is not processed in it. Compare the various cases in this babelmark

So I'm going to close this pull request as HTML support is a whole other can of worms more than just this commit.

(My personal view on inline HTML in markdown is that it goes against using a plain text format but it is in the spec so we should support it. Somehow)