Tell us what’s happening:
Hello, I created a basic controlled text area.
Now, I am trying to pass the text input to get it’s markdown version.
I copied the following code from the challenge example:
const Preview = (props) => {
return (
<div
dangerouslySetInnerHTML={{
__html: marked(props.markdown, { renderer: renderer })
}}
id="preview"
/>
);
};
And imported the following library on codepen:
https://cdnjs.cloudflare.com/ajax/libs/marked/2.0.3/marked.min.js
I am receiving the following error. It appears that the marked library hasn’t been recognised
https://cdnjs.cloudflare.com/ajax/libs/marked/2.0.3/marked.min.js
Here is my code so far
Please uncomment the following code so you can see the error happening.
/*dangerouslySetInnerHTML={{
__html: marked(props.markdown, { renderer: renderer })
}}*/
Help appreciated!
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:101.0) Gecko/20100101 Firefox/101.0
Challenge: Build a Markdown Previewer
Link to the challenge: