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
Logically thinking, why would running the test make a difference to the outputted webpage? Here is my train of thought:
Running the tests = checking if multiple test cases are satisfied or not
= performing interactions with the web page and observing the results/changes (+ seeing if these results/changes are satisfactory)
= causing some sort of input handler to run, as a result of these interactions (otherwise the page would just be a pointless static png)
= (probably) the markdown function will be ran
= special characters are interpreted
= 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?
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
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