default transforming html #104

Closed
fahrvergnuugen opened this Issue Jun 10, 2013 · 6 comments

3 participants

@fahrvergnuugen

My understanding is that this should work:

Markdown::defaultTransform('<p>a</p>
<p>b</p>
<p>c</p>');

Should output:

<p>a</p>
<p>b</p>
<p>c</p>

This is verified by gruber's online dingus.

Instead it outputs:

<p>a</p>

<p><p>b</p>
<p>c</p></p>
@Avalarion

Please use CodeFormatition^^. I am not able to see a difference.

@fahrvergnuugen

My tabs did not paste, I reformatted with spaces, so the code blocks should work now.

@michelf
Owner

If you write this instead it'll pass with no problem:

<p>
a
</p>

But I think this deserves to be corrected nonetheless. Note that the MarkdownExtra parser does not have this problem.

@michelf
Owner

Oops. I meant you if you write this it'll pass:

<p>a</p>

<p>b</p>

<p>c</p>

The blank lines before and after each paragraph make it conforms with the syntax description which says:

The only restrictions are that block-level HTML elements — e.g. <div>, <table>, <pre>, <p>, etc. — must be separated from surrounding content by blank lines, and the start and end tags of the block should not be indented with tabs or spaces. Markdown is smart enough not to add extra (unwanted) <p> tags around HTML block-level tags.

@fahrvergnuugen

Interesting note on the syntax description. If you test on the dingus you'll see it works there, which is odd.

@fahrvergnuugen

Using markdownExtra solved my problem, so thank you for that tip!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment