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

Adding support for markdown within HTML tags #4

Closed
fredleblanc opened this issue Jun 3, 2014 · 27 comments
Closed

Adding support for markdown within HTML tags #4

fredleblanc opened this issue Jun 3, 2014 · 27 comments

Comments

@fredleblanc
Copy link

We've recently included Parsedown (Extra) into Statamic (and, by the way, I love it, it's so quick and does a much, much better job of handling the weird edge cases).

Anyway, someone has submitted a ticket to our support system asking about support in Parsedown (Extra) for markdown="1" for parsing within HTML elements. (It's part of Markdown Extra).

So, I'm here doing my due diligence. Is this feature something on the Parsedown Extra roadmap for implementation? Is it perhaps already implemented but slightly different syntax from Markdown Extra?

Thanks for your time (and for such an awesome markdown parser).
Fred

@jackmcdade
Copy link

👍

@erusev erusev added the issue label Jun 3, 2014
@erusev
Copy link
Owner

erusev commented Jun 3, 2014

Is this feature something on the Parsedown Extra roadmap for implementation?

It is. I've been working on it.

@fredleblanc
Copy link
Author

Yessss, fantastic. Thank you!

@lakhman
Copy link

lakhman commented Jun 9, 2014

+1
This would be a great feature! its one of the few things missing from what I can tell!
Thanks!

@fxck
Copy link

fxck commented Jun 29, 2014

+1

Do want.

@jeffreydking
Copy link

+1

@olivier
Copy link

olivier commented Jul 27, 2014

Great, thanks !

@fxck
Copy link

fxck commented Jul 27, 2014

Is there any actual roadmap? This and https://michelf.ca/projects/php-markdown/extra/#spe-attr would be great..

@DevCharly
Copy link

+1

1 similar comment
@prigal
Copy link

prigal commented Jul 29, 2014

+1

@jeffreydking
Copy link

One caveat. The contents of script tags should never be parsed.

@icylace
Copy link

icylace commented Aug 16, 2014

+1

@erusev
Copy link
Owner

erusev commented Aug 16, 2014

The latest commit (7578fe2) tries to address this. It is not a complete solution. It won't work on nested tags and, since I haven't had much time to test it or write tests for it, I can't guarantee it's stable.

@bzerangue
Copy link

+1

@bzerangue
Copy link

@erusev - now that you have added this, it seems to working properly!!! Thank you so much for adding this feature to Parsedown Extra!!!!!!

@puckey
Copy link

puckey commented Sep 24, 2014

+1 for nested tags support

@adeniszczyc
Copy link

+1

@mnapoli
Copy link

mnapoli commented Nov 25, 2014

+1!

When this is nested is another HTML node, it doesn't work:

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

Try it on http://parsedown.org/extra/

@lyrixx
Copy link

lyrixx commented Dec 7, 2014

I have the same need too.

@erusev
Copy link
Owner

erusev commented Dec 7, 2014

We are working on it.

@lyrixx
Copy link

lyrixx commented Dec 7, 2014

Thanks ;)

@kleinsch
Copy link

+1

@erusev
Copy link
Owner

erusev commented Jan 10, 2015

I believe that the latest release resolves this.

@erusev erusev closed this as completed Jan 10, 2015
@lakhman
Copy link

lakhman commented Jan 10, 2015

Awesome!! Thanks so much!! I'm gonna update now! 👍

@erusev
Copy link
Owner

erusev commented Jan 10, 2015

Ok, it does work for tags that are nested in tags that have markdown=1, but it still doesn't work for tags that are nested in tags that don't have it.

I'm reopening this.

@erusev erusev reopened this Jan 10, 2015
@erusev
Copy link
Owner

erusev commented Jan 12, 2015

Ok, now it should always work.

@samuelgfeller
Copy link

samuelgfeller commented May 21, 2024

Ok, now it should always work.

It does not for me now when I don't specifically add markdown="1" to every HTML block.. am I doing something wrong?

This is my code:

$markdown = 'Link: [parsedown](https://parsedown.org/)

<div markdown="1">
Link: [parsedown](https://parsedown.org/)  
</div>

<div>
Link: [parsedown](https://parsedown.org/)  
</div>

<details>
<summary><b>Click to see</b></summary>

## Title  
Link: [parsedown](https://parsedown.org/)   
Code: `codeblock`  
</details>
';

$parser = new ParsedownExtra();
echo $parser->text($markdown);

This is the HTML I get:

<p>Link: <a href="https://parsedown.org/">parsedown</a></p>
<div>
<p>Link: <a href="https://parsedown.org/">parsedown</a>  </p>
</div>
<div>
Link: [parsedown](https://parsedown.org/)  
</div>
<details>
<summary><b>Click to see</b></summary>

## Title  
Link: [parsedown](https://parsedown.org/)   
Code: `codeblock`  
</details>

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

No branches or pull requests