parsedown icon indicating copy to clipboard operation
parsedown copied to clipboard

Feature request: Remove markdown from plain text

Open Nerdmind opened this issue 7 years ago • 7 comments

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!

Nerdmind avatar Apr 24 '17 00:04 Nerdmind

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 screen shot 2017-04-24 at 12 05 32

We get this output: screen shot 2017-04-24 at 12 05 47

aidantwoods avatar Apr 24 '17 11:04 aidantwoods

Hi. Thank you. I think, that works! :+1:

Nerdmind avatar Apr 24 '17 13:04 Nerdmind

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.

MarkMessa avatar Sep 03 '19 05:09 MarkMessa

@aidantwoods i also need this? is there a new version of this that works?

djschilling avatar Feb 23 '21 15:02 djschilling

ping

djschilling avatar Feb 09 '22 17:02 djschilling

I can probably work something up against the 2.0 branch. Mostly out of curiosity, what use case do you have for this? 😄

aidantwoods avatar Feb 09 '22 20:02 aidantwoods

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.

djschilling avatar Feb 09 '22 21:02 djschilling