Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backtick in CSS causes UI to crash #2384

Open
outoftime opened this issue Oct 30, 2020 · 1 comment
Open

Backtick in CSS causes UI to crash #2384

outoftime opened this issue Oct 30, 2020 · 1 comment
Labels

Comments

@outoftime
Copy link
Contributor

outoftime commented Oct 30, 2020

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

View on Bugsnag

Stacktrace

View full stacktrace

Created by Matthew Brown via Bugsnag

@adrianfalleiro
Copy link
Contributor

@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});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants