popcode
popcode copied to clipboard
Backtick in CSS causes UI to crash
The following CSS will trigger the error:
.section{
color:#f7beba;
border-radius:200px;
height:`0px;
}
body{background-color:#95beba;}
.name{text-align:center;}
Error in Popcode
Error in /
Unknown language: isn't is not registered
Stacktrace
Created by Matthew Brown via Bugsnag
@outoftime This doesn't completely fix the issue, but we can stop the app from crashing by adding ignoreMissing: true to therehype-highlight plugin in remarkWithHighlighting() in src/util/markdown.js
return unified()
.use(markdown)
.use(externalLinks)
.use(remark2rehype)
.use(sanitize, schema)
.use(highlight, {
subset: ['css', 'js', 'xml'],
languages: {css, js, xml},
ignoreMissing: true,
})
.use(rehype2react, {createElement});