Markdown Previewer Problem

Hello!
I’m currently working on my Markdown Previewer project in the front end libraries section. I’ve everything correct in the UI but if I run the test it fails test 4:

#preview's only children should be those rendered by marked.js : expected '<div id="preview"></div>' to equal ''
AssertionError: #preview's only children should be those rendered by marked.js : expected '<div id="preview"></div>' to equal ''
    at Proxy.h (https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:531:2123)
    at Proxy.u (https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:407:130)
    at n.strictEqual (https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:556:655)
    at n.<anonymous> (https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:581:158089)
    at https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:575:265533
    at Kb.run (https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:575:265828)
    at CC.runTest (https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:575:280794)
    at https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:575:281730
    at o (https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:575:280133)
    at https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:575:280203

But IDK why this happens because when I write text in the #editor it does show up in my #preview.
I hope somebody could help!

You have the preview id on two elements. The test will look at the first one which is the outer element and that one does not have the HTML output. Remove the id from the outer div.

If you want to pass the last test use the correct option for it (the breaks option)

https://marked.js.org/using_advanced#options

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