I have made a markdown previewer using react and react-markdown .
All my tests pass except the Optional bonus where you have to interpret carriage returns as .
Ive tried doing this:
The markedjs library has an option for this, not sure about react-markdown. I see the <br> is on the allowedTypes list but I do remember seeing others having issues with this when using react-markdown. Don’t remember if there is a solution to this, but you should use the options the library comes with before trying to insert the element manually.
Not sure what the issue is, all the test does is add a string to the value property on the textarea element and does a .match on the innerHTML of the preview element.