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

remove markdown #413

Closed
basith374 opened this issue Aug 2, 2016 · 4 comments · Fixed by #576
Closed

remove markdown #413

basith374 opened this issue Aug 2, 2016 · 4 comments · Fixed by #576
Labels

Comments

@basith374
Copy link

can we get this feature? i want parsedown to remove markdown & convert to plain text

@Exagone313
Copy link

The Parsedown code is easy to read and extendable (see the wiki), just do your own extension for that kind of features.

@wkhayrattee
Copy link

wkhayrattee commented Oct 25, 2016

@basith374 you probably need something similar to this https://github.com/stiang/remove-markdown, but in PHP. You could reuse the logic in there and implement it in PHP.

I agree with @Exagone313 that you could just implement this logic as an extension for your use-case and probably sharing it with the parsedown community as well.

@kjdion84
Copy link

kjdion84 commented Mar 7, 2018

Using PHP:

function remove_markdown($value)
{
	$parsedown = new Parsedown();
	$html = $parsedown->text($value);

	return strip_tags($html);
}

@aidantwoods
Copy link
Collaborator

Interestingly once #576 is ready, as an extension it will be possible to traverse the AST after markdown parsing is finished and pick out only text, or even other relevant bits of data too (e.g. if you wanted to include image descriptions, say). This should be relatively easy to implement once the AST is available.

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

Successfully merging a pull request may close this issue.

5 participants