Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

default transforming html #104

Closed
PaulWieland opened this issue Jun 10, 2013 · 6 comments
Closed

default transforming html #104

PaulWieland opened this issue Jun 10, 2013 · 6 comments

Comments

@PaulWieland
Copy link

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
Copy link

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

@PaulWieland
Copy link
Author

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

@michelf
Copy link
Owner

michelf commented Jun 10, 2013

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
Copy link
Owner

michelf commented Jun 10, 2013

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.

@PaulWieland
Copy link
Author

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

@PaulWieland
Copy link
Author

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants