Build a Markdown Previewer How To Convert Using The Library

Hi,i used the link and added the library of the markdown and i know how to use the react and redux well…but for so many hours i have tried to learn how to make use of that library in-order to convert the Html into markdown and vice versa and i failed everytime so, i would really really appreciate it if someone would tell me where exactly do i find the syntax that makes me able to convert and make use of the library i added.

I understand the frustration. This one took me a while too.

The link that FreeCodeCamp provides doesn’t come with any documentation, and working with libraries and their documentation is certainly something you learn along the way. You can find it here, but the long and short of it is that you just have to pass the original text through marked(), which returns the text in Markdown. For example:

let markdownText = marked(originalText)

That’s all there is to it! Not sure if that’s going to increase or decrease your frustration but at least you can move forward now. If you need to see it in action, here’s my pen.