# Markdown Previewer Test #6

**URL:** <https://forum.freecodecamp.org/t/markdown-previewer-test-6/615679>\
**Category:** General\
**Created:** [June 13, 2023, 10:39am UTC](https://forum.freecodecamp.org/t/markdown-previewer-test-6/615679 "2023-06-13T10:39:47Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![aws.yaseen.22](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/aws.yaseen.22/32/321110_2.png) [@aws.yaseen.22](https://forum.freecodecamp.org/u/aws.yaseen.22)\
**Post date:** [June 13, 2023, 10:39am UTC](https://forum.freecodecamp.org/t/markdown-previewer-test-6/615679/1 "2023-06-13T10:39:47Z")

</div>

Hi there;  
I finished the Markdown previewer project using React and markdownit library;  
I have a mysterious problem that when I press the “Run tests” button it pass all the test except the test number #6 BUT when i press “Run tests” button again it passes the tests???  
Any hint/help !!! please

here is the pen:

> **[markdownPreviewer](https://codepen.io/awsyaseen22/pen/mdQJaqw)**
>
> ...

Regards

Aws

---

<div class="post-metadata">

**Author:** ![reesooyt](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/reesooyt/32/316976_2.png) [@reesooyt](https://forum.freecodecamp.org/u/reesooyt)\
**Post date:** [June 13, 2023, 4:42pm UTC](https://forum.freecodecamp.org/t/markdown-previewer-test-6/615679/2 "2023-06-13T16:42:11Z")

</div>

Logically thinking, why would running the test make a difference to the outputted webpage? Here is my train of thought:

1. Running the tests = checking if multiple test cases are satisfied or not
2. = performing interactions with the web page and observing the results/changes (+ seeing if these results/changes are satisfactory)
3. = causing some sort of input handler to run, as a result of these interactions (otherwise the page would just be a pointless static png)
4. = (probably) the markdown function will be ran
5. = special characters are interpreted
6. = newlines, tables, and other special characters seem to be completely present before the test is ran, are there any other special characters which aren’t present before the tests are ran, causing your #6 test to initially fail?

OR

1. Observe the page before the test runs
2. Obverse the page after the test runs
3. Are there any visible differences? ← In your case
4. Are there any invisible (state) differences?

For the exact answer and solution, please like my codepen then give me a ping - I’ve just finished the same project too :]  
[yanfei tofu (main account copy) (codepen.io)](https://codepen.io/omakeinu/pen/NWEGYar)

---

<div class="post-metadata">

**Author:** ![aws.yaseen.22](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/aws.yaseen.22/32/321110_2.png) [@aws.yaseen.22](https://forum.freecodecamp.org/u/aws.yaseen.22)\
**Post date:** [June 13, 2023, 5:31pm UTC](https://forum.freecodecamp.org/t/markdown-previewer-test-6/615679/3 "2023-06-13T17:31:51Z")

</div>

Thanks a lot reesooyt;  
I just use your sample of the InitialEditorText that you mention in your great hints.  
Appreciate your reply  
Great work by the way

---

<div class="post-metadata">

**Author:** ![aws.yaseen.22](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/aws.yaseen.22/32/321110_2.png) [@aws.yaseen.22](https://forum.freecodecamp.org/u/aws.yaseen.22)\
**Post date:** [June 13, 2023, 5:33pm UTC](https://forum.freecodecamp.org/t/markdown-previewer-test-6/615679/4 "2023-06-13T17:33:33Z")

</div>

how to give you a ping!?

---

<div class="post-metadata">

**Author:** ![reesooyt](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/reesooyt/32/316976_2.png) [@reesooyt](https://forum.freecodecamp.org/u/reesooyt)\
**Post date:** [June 14, 2023, 9:55am UTC](https://forum.freecodecamp.org/t/markdown-previewer-test-6/615679/5 "2023-06-14T09:55:27Z")

</div>

I forgot that this wasn’t Discord so I didn’t mean a ping 😓

Have you figured out your issue?

If not:

The \r carriage return tag is interpreted correctly by Markdown, but not by HTML. (The equivalent would be \<br\>, or using CSS properties)  
Therefore, before the test begins, the un-Markdown-processed initial text does not contain the carriage return. However, after the tests are ran and interactions are made, the Markdown-processing function is ran, and correctly interpretates the carriage break.

It is this lack of carriage return that is causing your initial tests to fail 👍

---

<div class="post-metadata">

**Author:** ![aws.yaseen.22](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/aws.yaseen.22/32/321110_2.png) [@aws.yaseen.22](https://forum.freecodecamp.org/u/aws.yaseen.22)\
**Post date:** [June 16, 2023, 9:20pm UTC](https://forum.freecodecamp.org/t/markdown-previewer-test-6/615679/6 "2023-06-16T21:20:54Z")

</div>

Thanx for your kindness 💐

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/freecodecamp/original/3X/e/1/e1c433102e34b46dfaa3e15d13ab9a514b127078.svg) [@system](https://forum.freecodecamp.org/u/system)\
**Post date:** [December 16, 2023, 9:21am UTC](https://forum.freecodecamp.org/t/markdown-previewer-test-6/615679/7 "2023-12-16T09:21:35Z")

</div>

Closed on December 16, 2023, 9:21am UTC

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