我有下面的代码,它可以帮助我显示带有语法突出显示的降价组件。一切正常,除非我输入```
总是会发生,因为我从输入字段中获取降价源。
const renderers = {
code:({language,value})=>{
return <SyntaxHighlighter style={dark} language={"dart"} children={value} />
}
}
export default function CodeMarkDown(props){
return (
<ReactMarkdown renderers={renderers} children={props.markdown}></ReactMarkDown>
)
}
正如我之前所说,每当我输入```
或~~~
它破坏应用程序之前,我能够使用带有此错误消息的剩余引号关闭它
Reactmarkdown Uncaught TypeError: Cannot read property 'match' of undefined at getNewLines (highlight.js:10)
到目前为止我所尝试的:
I have tried replacing each ``` with \`\`\` but when I do I it cant be formatted as markdown anymore.