I am facing some issues in the “Build a Markdown Previewer” project. The issue seems to arise from the “Marked” library as it sometimes renders correct HTML and sometimes doesn’t. For example, I can see it successfully renders “# Heading 1” correctly as an <h1></h1> element; however, it doesn’t seem to render “## Heading 2”
as an <h2></h2> element; instead, it renders it as an <h1></h1> element too. I think that’s also the reason that test 6 is failing for me (it doesn’t render HTML correctly). I tried using different versions of the library without any success. There also seems to be a problem with spacing: whenever I type a blank space in the editor, I can’t really see the space showing anywhere in the previewer.
I’ve edited your post for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.
You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.