Front End Development Libraries Projects - Build a Markdown Previewer

Marked not working: markdown previewer

(it says marked function is not defined)

Is this a bug of marked plugin link or am I doing something wrong?

const markdown = marked(text);

  • what is “marked”, where does it come from (imports)?

are you forgetting to “import” it from any “library” of some sort? happy learning :slight_smile:

1 Like

thanks for a respond!
yes, marked is a function which comes from an import. I did add the right one form library but for some reason it doesn’t work.

Use the parse() method.

const markdown = marked.parse(text);

https://marked.js.org/#usage

The element with dangerouslySetInnerHTML should not have any child elements (i.e. the p element you have inside it).

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.