Markdown Previewer fails test #6, not detecting h1 tag in preview

Tell us what’s happening:
Ok, so… I’ve beat my head against the wall trying to figure this out - I’m not sure why it’s not passing #6. This error triggers both locally and on CodePen, yet my #preview clearly has the h1 tags by default upon inspection with dev tools. So frustrating… it passes all of the other tests, including the bonuses. Is there a bug in the testing code?

Here’s the error from the “failed” test:

X 6. When my markdown previewer first loads, the default markdown in the #editor field should be rendered as HTML in the #preview element

AssertionError: #preview does not contain the H1 element represented by the markdown in the #editor field with the inner text Heading 1   : expected 0 to be at least 1
    at Function.assert.isAtLeast (
    at n.<anonymous> (
    at r (
    at (
    at i.runTest (
    at r (
    at n (
    at i (

Your code so far .

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.87 Safari/537.36.

Link to the challenge:

1 Like

Maybe you should 't call function in div, it’s not good practice, is better to call state variable.
look here

Maybe so, but I got that directly from the React Docs.

1 Like

And, it still doesn’t explain why the test isn’t detecting the h1 tag that is obviously there.

Remove the whitespace after Heading 1 and Heading 2, you should be good.

Thx… that worked! Weird. I’ve always been in the habit of using two spaces before a CR when writing MD text. I guess the regex in the tests don’t like that.