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

breaks on semicolon after data:image #28

Description

@loopmode

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;');

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions