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

Add Markdown Inside HTML Blocks like Markdown Extra #14

Closed
bzerangue opened this issue Sep 2, 2014 · 5 comments
Closed

Add Markdown Inside HTML Blocks like Markdown Extra #14

bzerangue opened this issue Sep 2, 2014 · 5 comments

Comments

@bzerangue
Copy link

Would be really helpful for Parsedown Extra to add Markdown Inside HTML Blocks

Previously in Markdown, you couldn’t wrap Markdown-formatted content inside a <div> element. This is because <div> is a block element and plain Markdown does not format the content of such.

Markdown Extra gives you a way to put Markdown-formatted text inside any block-level tag. You do this by adding a markdown attribute to the tag with the value 1 — which gives markdown="1" — like this:

<div markdown="1">
This is *true* markdown text.
</div>

The markdown="1" attribute will be stripped and <div>’s content will be converted from Markdown to HTML. The end result will look like this:

<div>
<p>This is <em>true</em> markdown text.</p>
</div>

https://michelf.ca/projects/php-markdown/extra/#markdown-attr

@bzerangue
Copy link
Author

Sorry. This is already requested here...

#4

@erusev
Copy link
Owner

erusev commented Sep 2, 2014

<div markdown="1">
This is *true* markdown text.
</div>

Doesn't this work as expected in the latest version of ParsedownExtra?

@bzerangue
Copy link
Author

This does seem to be working! Thank you @erusev!

@erusev
Copy link
Owner

erusev commented Sep 6, 2014

@bzerangue I'm glad to hear that.

@frumbert
Copy link

I think this needs to have a note on it that the markdown tag needs to be on every tag that is a direct parent of the element - so

<div markdown="1">
    <blockquote>
        this is *true* markdown
   </blockquote>
</div>

doesn't work but

<div>
    <blockquote markdown="1">
        this is *true* markdown
   </blockquote>
</div>

does

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