Is there a way to look at the test cases, particularly the strings used for testing, in the Markdown Previewer tester? I’m failing on test 3 and 4, the markdown doesn’t match the preview box, yet to me, it appears to. I’m not sure how to narrow this down.
3. When I enter text into the #editor element, the #preview element is updated as I type to display the content of the textarea
#preview is not being updated as I type into #editor (should update on every keyup) : expected 'W' to equal 'a'
4. When I enter GitHub flavored markdown into the #editor element, the text is rendered as HTML in the #preview element as I type (Hint: You don't need to parse Markdown yourself - you can import the Marked library for this: https://cdnjs.com/libraries/marked)
#preview's only children should be those rendered by marked.js : expected '<h1>Welcome to my React Markdown Prev…' to equal ''
Test 5 and 6 pass. Optional test 7 fails despite setting gfm
and breaks
to true in the marked-react
component.
This is my Preview
component.
import TitleBar from "./window/TitleBar";
import CopyBtn from "./buttons/CopyBtn";
import Markdown from "marked-react";
import {faMarkdown} from "@fortawesome/free-brands-svg-icons";
function Preview({output}) {
console.log(output)
return (
<div className={"window"} >
< TitleBar title={"Preview"} icon={faMarkdown}/>
<div id={"preview"} >
<Markdown gfm={true} breaks={true}>{output}</Markdown>
</div>
< CopyBtn content={output} />
</div>
)
}
export default Preview;