parsedown
parsedown copied to clipboard
Feature request: Remove markdown from plain text
Hi. I want to ask if it is possible to create a function to remove the Markdown formatting from a plain text. Here is an example of what I mean:
Markdown …
Hello World. This is **bold text** and here is a link to a [website](https://example.org/)! Oh: ![A cute kitten](https://example.org/static/images/cat.svg)!
… converting to plain text:
Hello World. This is bold text and here is a link to a website! Oh: A cute kitten!
Not too difficult to create an extension to do it by overwriting the element
method: https://github.com/aidantwoods/parsedown/tree/plain-text-parsedown-ext
E.g. with this test file
We get this output:
Hi. Thank you. I think, that works! :+1:
Just for the records: this solution from @aidantwoods works fine on version 1.6.0 but it doesn't seem to work anymore on version 1.8.0-beta-7.
@aidantwoods i also need this? is there a new version of this that works?
ping
I can probably work something up against the 2.0
branch. Mostly out of curiosity, what use case do you have for this? 😄
We want to use it as a teaser for the actual markdown page we want to show. In the teaser no rendered markdown should be shown but only the plain text.