erusev / parsedown

Better Markdown Parser in PHP
https://parsedown.org
MIT License
14.76k stars 1.12k forks source link

Strip markdown? #861

Open ve3 opened 8 months ago

ve3 commented 8 months ago

Do you have plan to implement strip markdown?

Use case:

Example that I have this string.

Hello **world**, do not `escape()` to the moon.<br>
End

With ParseDown, I can convert this markdown syntax to HTML in normal contents display part. But in some part such as HTML attribute or excerpt, I just want to strip all markdown to be like this.

Hello world, do not escape() to the moon.<br>
End

It's okay to strip just markdown and leave HTML to PHP strip_tags() function task.
So that I can strip markdown and HTML and put in HTML attribute or excerpt part like this.

<div id="post-12345" title="Hello world, do not escape() to the moon.End">...</div>