Markdown Previewer Test #6

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:



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?


  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) (

1 Like

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

how to give you a ping!?

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

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 :+1:

Thanx for your kindness :bouquet:

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