Markdown Previewer - issues with test #4

So, i built the markdown previewer, and it works and renders like it should (i guess), but it does not pass the #4 test, only. At first i thought it was about the addEventListener(“keyup”) but i already passed that error.

the error is > AssertionError: #preview is not being updated as I type into #editor (should update on every keyup) : expected ‘p’ to equal ’ ’

var e="The markdown in #editor is not being interpreted correctly and/or rendered into #preview ";l(""),a.assert.strictEqual(n.innerHTML,"","#preview's only children should be those rendered by marked.js "),l("testing"),a.assert.strictEqual(n.innerHTML.trim(),"<p>testing</p>",e),l(r.value+" and..."),a.assert.strictEqual(n.innerHTML.trim(),"<p>testing and...</p>",e),l("# h1 \n## h2"),a.assert.isTrue(2===n.children.length&&"H1"===n.children[0].nodeName&&"h1"===n.children[0].innerHTML&&"H2"===n.children[1].nodeName&&"h2"===n.children[1].innerHTML,'"# h1 \n## h2" should be rendered as <h1>h1</h1>\n<h2>h2</h2>\n'),l("**bold**"),a.assert.strictEqual(n.innerHTML.trim(),"<p><strong>bold</strong></p>",e)

can someone look up my code to tell me what am i doing wrong??

im guessing my ‘\n’ is not working, but how do i fix it?

so after some minutes i got it. turns out i had an if( on line 37 that was bugging the spaces as false

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