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?
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);
are you forgetting to “import” it from any “library” of some sort? happy learning
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);
The element with dangerouslySetInnerHTML
should not have any child elements (i.e. the p
element you have inside it).
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.