Tell us what’s happening:
I’ll be crazy. Test 5 wont pass. Can someone help me? I even copied and pasted example’s markdown text. BUT IT WONT PASS DAMN. OF COURSE I HAVE MADE MY OWN MARKDOWN TEXT IF YOU OBSESSED SO MUCH ABOUT PLAGIARISM. HERE IT IS:
H1 Element \n ## H2 element \n Google is here: go to Google \n\n Inline Code
\n\n <ul><li></li><li></li></ul>
\n\n\n 1. First 2. Second 3. Third \n\n\n > Blockquote is here. \n\n\n \n\n\n This is bold text.
THANK YOU.
MY code so far
import * as React from "https://cdn.skypack.dev/react@17.0.1";
import * as ReactDOM from "https://cdn.skypack.dev/react-dom@17.0.1";
import * as bootstrap from "https://cdn.skypack.dev/bootstrap@5.1.3";
import $ from "https://cdn.skypack.dev/jquery@3.6.0";
import * as marked from "https://cdn.skypack.dev/marked@4.0.0";
class MyComponent extends React.Component {
constructor(props) {
super(props);
this.state = {
text: `# Welcome to my React Markdown Previewer!
## This is a sub-heading...
### And here's some other cool stuff:
Heres some code, \`<div></div>\`, between 2 backticks.
\`\`\`
// this is multi-line code:
function anotherExample(firstLine, lastLine) {
if (firstLine == '\`\`\`' && lastLine == '\`\`\`') {
return multiLineCode;
}
}
\`\`\`
You can also make text **bold**... whoa!
Or _italic_.
Or... wait for it... **_both!_**
And feel free to go crazy ~~crossing stuff out~~.
There's also [links](https://www.freecodecamp.com), and
> Block Quotes!
And if you want to get really crazy, even tables:
Wild Header | Crazy Header | Another Header?
------------ | ------------- | -------------
Your content can | be here, and it | can be here....
And here. | Okay. | I think we get it.
- And of course there are lists.
- Some are bulleted.
- With different indentation levels.
- That look like this.
1. And there are numbererd lists too.
1. Use just 1s if you want!
1. But the list goes on...
- Even if you use dashes or asterisks.
* And last but not least, let's not forget embedded images:
![React Logo w/ Text](https://goo.gl/Umyytc)
`
}
this.handleChange = this.handleChange.bind(this);
}
handleChange(event) {
this.setState({
text: event.target.value
})
}
render () {
return (<div>
<div>
<textarea id="editor" onChange={this.handleChange} value={this.state.text}></textarea>
</div>
<div>
<div id="preview" dangerouslySetInnerHTML= {{__html: marked.parse(this.state.text)}}></div>
</div>
</div>)
}
}
ReactDOM.render(<MyComponent />, document.getElementById("main-div"));
MY browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.54 Safari/537.36 Edg/95.0.1020.40
Challenge: Build a Markdown Previewer
Link to the challenge: