# Help with Markdown Preview

**URL:** <https://forum.freecodecamp.org/t/help-with-markdown-preview/337979>\
**Category:** General\
**Created:** [January 3, 2020, 8:50am UTC](https://forum.freecodecamp.org/t/help-with-markdown-preview/337979 "2020-01-03T08:50:39Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ShubhamCanMakeCommit](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/shubhamcanmakecommit/32/129953_2.png) [@ShubhamCanMakeCommit](https://forum.freecodecamp.org/u/ShubhamCanMakeCommit)\
**Post date:** [January 3, 2020, 8:50am UTC](https://forum.freecodecamp.org/t/help-with-markdown-preview/337979/1 "2020-01-03T08:50:39Z")

</div>

**I’m not able to pass the 6th test**  
I have also used a `console.log()` statement at the bottom which clearly should pass the test.  
[codepen with issue](https://codepen.io/shubhamcanmakecommit/pen/WNbXRMX?editors=1011)  
Also below would have a completely different behaviour.

```auto

window.onload=function(){ReactDOM.render(<App/>,document.getElementById('root'))}
console.log(document.querySelectorAll('#preview h1'))

```

---

<div class="post-metadata">

**Author:** ![jenovs](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/jenovs/32/60963_2.png) [@jenovs](https://forum.freecodecamp.org/u/jenovs)\
**Post date:** [January 3, 2020, 9:41am UTC](https://forum.freecodecamp.org/t/help-with-markdown-preview/337979/2 "2020-01-03T09:41:50Z")

</div>

Remove `DOMPurify.sanitize`

---

<div class="post-metadata">

**Author:** ![ShubhamCanMakeCommit](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/shubhamcanmakecommit/32/129953_2.png) [@ShubhamCanMakeCommit](https://forum.freecodecamp.org/u/ShubhamCanMakeCommit)\
**Post date:** [January 3, 2020, 9:43am UTC](https://forum.freecodecamp.org/t/help-with-markdown-preview/337979/3 "2020-01-03T09:43:28Z")

</div>

That won’t help I’ve tried.

---

<div class="post-metadata">

**Author:** ![jenovs](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/jenovs/32/60963_2.png) [@jenovs](https://forum.freecodecamp.org/u/jenovs)\
**Post date:** [January 3, 2020, 10:01am UTC](https://forum.freecodecamp.org/t/help-with-markdown-preview/337979/4 "2020-01-03T10:01:47Z")

</div>

Line 56, change to:

```auto
parsedObject:{__html:marked(placeholder)}

```

---

<div class="post-metadata">

**Author:** ![ShubhamCanMakeCommit](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/shubhamcanmakecommit/32/129953_2.png) [@ShubhamCanMakeCommit](https://forum.freecodecamp.org/u/ShubhamCanMakeCommit)\
**Post date:** [January 3, 2020, 10:05am UTC](https://forum.freecodecamp.org/t/help-with-markdown-preview/337979/5 "2020-01-03T10:05:08Z")

</div>

How come did this get the code work?

---

<div class="post-metadata">

**Author:** ![jenovs](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/jenovs/32/60963_2.png) [@jenovs](https://forum.freecodecamp.org/u/jenovs)\
**Post date:** [January 3, 2020, 10:30am UTC](https://forum.freecodecamp.org/t/help-with-markdown-preview/337979/6 "2020-01-03T10:30:22Z")

</div>

I guess it’s because of `marked.setOptions({breaks:true})` - if you put it immediately after `const placeholder=...` the tests will pass even with the initial version.

---

<div class="post-metadata">

**Author:** ![ILM](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/ilm/32/363239_2.png) [@ILM](https://forum.freecodecamp.org/u/ILM)\
**Post date:** [June 1, 2021, 7:38pm UTC](https://forum.freecodecamp.org/t/help-with-markdown-preview/337979/7 "2021-06-01T19:38:38Z")

</div>

Closed on June 1, 2021, 7:38pm UTC


