Skip to content
This repository has been archived by the owner on Aug 6, 2021. It is now read-only.

breaks on semicolon after data:image #28

Open
loopmode opened this issue Feb 12, 2020 · 0 comments
Open

breaks on semicolon after data:image #28

loopmode opened this issue Feb 12, 2020 · 0 comments

Comments

@loopmode
Copy link

loopmode commented Feb 12, 2020

Hi.
I just observed an issue where background: url('data:image/svg+xml;charset=utf-8,<svg%20version%... becomes invalid CSS due to a linebreak after semicolon:

 background: url('data:image/svg+xml;
    charset=utf-8,<svg%20version%...

(This is in the "funky" theme of Prism.js)

I have a very limited scope in my project so I will "fix" the problem using a simple string operation, but I wanted to report the case here.

I don't believe I'll have time for an actual fix and PR, but will report if I do.

In case somebody stumbles across this and needs a naive but simple solution, the workaround for my particular example goes something like this:

  const prefixedCss = parser
    .getCSSForEditor(namespaced)
    // see https://github.com/jotform/css.js/issues/28
    .replace(/svg\+xml;\n    /, 'svg+xml;');
@loopmode loopmode changed the title breaks on data:image breaks on semicolon after data:image Feb 12, 2020
loopmode added a commit to codeblockjs/codeblock that referenced this issue Feb 12, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant