Laverage
Jan 06 2020 at 07:38 GMT
I have some markdown that I want to convert to plain text.
For example,
const markdown = 'Markdown **is** _great_. `But` I want\n```\nplain text\n```'
markdownToPlainText(markdown)
// Should output:
// Markdown is great. But I want
// plain text
What npm package can I use to accomplish that?
Mike The Programmer
Jan 06 2020 at 07:46 GMT
There's an npm package called remove-markdown
that you can use to do the markdown to plain text conversion.
npm install remove-markdown
Here's how to use it:
const removeMd = require('remove-markdown')
const markdown = 'Markdown **is** _great_. `But` I want\n```\nplain text\n```\n'
const plainText = removeMd(markdown)
console.log(plainText)
// Output:
// Markdown is great. But I want
// plain text