I need help with the markdown previewer

My code doesn’t recognize marked as a function and it doesn’t pass any of the test even though I have all of the things its asking for.

Here is my code

Hello, @kreddick9 !
It would be much easier if you try to delete the JS code and write an uncopied HTML code.

Marked is not a function though, it is an object with a ton of methods attached to it.

Try changing the line in error to use the method parse on it instead?

marked.parse(content, { renderer: renderer })

It worked to render the page at least but there isn’t a test suite installed so I don’t know if it passes tests or not.

Just to clarify. I should delete the entire JS code I have? And just write it again as an HTML code?

Kaleb Reddick

Ok i’ll try this and see if it works.

thank you that help me solve the issue I was facing. I was following the instructions and it said I didn’t need to “4. When I enter GitHub flavored markdown into the #editor element, the text is rendered as HTML in the #preview element as I type (Hint: You don’t need to parse Markdown yourself - you can import the Marked library for this: marked - Libraries - cdnjs - The #1 free and open source CDN built to make life easier for developers)” so I was lost.
Again thank you very much

No problem, happy I could help!

I don’t know much about marked besides what I learned today, but I console.logged it after you imported it and got an object filled with methods, then checked the docs to find an example that was using .parse method, so I tried it and worked to render your page.

If you are working on a project locally (especially one using frameworks, libraries), its a lot faster to just deploy it to GitHub than trying to transfer it into a CodePen.

Thanks for the advice and yeah today is the day im really trying to learn all these things.

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