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

Double quoted url() arguments are parsed incorrectly #23680

Closed
1 of 15 tasks
Bykiev opened this issue Aug 3, 2022 · 1 comment · Fixed by #23691
Closed
1 of 15 tasks

Double quoted url() arguments are parsed incorrectly #23680

Bykiev opened this issue Aug 3, 2022 · 1 comment · Fixed by #23691

Comments

@Bykiev
Copy link

Bykiev commented Aug 3, 2022

🐞 Bug report

Command (mark with an x)

  • new
  • build
  • serve
  • test
  • e2e
  • generate
  • add
  • update
  • lint
  • extract-i18n
  • run
  • config
  • help
  • version
  • doc

Is this a regression?

unknown

Description

A clear and concise description of the problem...

The issue was discovered here and explored here with swagger-ui-dist package

A change in the npm package swagger-ui-dist changed the quotes around its url() arguments in swagger-ui.css from single to double. For example:

v4.12.0
background:url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="15" aria-hidden="true"><path fill="%23fff" fill-rule="evenodd" d="M4 12h4v1H4v-1zm5-6H4v1h5V6zm2 3V7l-3 3 3 3v-2h5V9h-5zM6.5 8H4v1h2.5V8zM4 11h2.5v-1H4v1zm9 1h1v2c-.02.28-.11.52-.3.7-.19.18-.42.28-.7.3H3c-.55 0-1-.45-1-1V3c0-.55.45-1 1-1h3c0-1.11.89-2 2-2 1.11 0 2 .89 2 2h3c.55 0 1 .45 1 1v5h-1V5H3v9h10v-2zM4 4h8c0-.55-.45-1-1-1h-1c-.55 0-1-.45-1-1s-.45-1-1-1-1 .45-1 1-.45 1-1 1H5c-.55 0-1 .45-1 1z"/></svg>') 50% no-repeat;

v4.13.0
background:url("data:image/svg+xml; charset=utf-8,<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"15\" aria-hidden=\"true\"><path fill=\"%23fff\" fill-rule=\"evenodd\" d=\"M4 12h4v1H4v-1zm5-6H4v1h5V6zm2 3V7l-3 3 3 3v-2h5V9h-5zM6.5 8H4v1h2.5V8zM4 11h2.5v-1H4v1zm9 1h1v2c-.02.28-.11.52-.3.7-.19.18-.42.28-.7.3H3c-.55 0-1-.45-1-1V3c0-.55.45-1 1-1h3c0-1.11.89-2 2-2 1.11 0 2 .89 2 2h3c.55 0 1 .45 1 1v5h-1V5H3v9h10v-2zM4 4h8c0-.55-.45-1-1-1h-1c-.55 0-1-.45-1-1s-.45-1-1-1-1 .45-1 1-.45 1-1 1H5c-.55 0-1 .45-1 1z\"/></svg>") 50% no-repeat;

🔬 Minimal Reproduction

Here is a demo project: https://github.com/nspire909/swagger-test

🔥 Exception or Error

./node_modules/swagger-ui-dist/swagger-ui.css - Error: Module Error (from ./node_modules/@angular-devkit/build-angular/node_modules/postcss-loader/dist/
cjs.js):
<css input>:34:8: Can't resolve '"data:image/svg+xml;charset=utf-8,<svg xmlns=/"http://www.w3.org/2000/svg/" width=/"16/" height=/"15/" aria-hidden=/"tr
ue/"><path fill=/"%23fff/" fill-rule=/"evenodd/" d=/"M4 12h4v1H4v-1zm5-6H4v1h5V6zm2 3V7l-3 3 3 3v-2h5V9h-5zM6.5 8H4v1h2.5V8zM4 11h2.5v-1H4v1zm9 1h1v2c-.
02.28-.11.52-.3.7-.19.18-.42.28-.7.3H3c-.55 0-1-.45-1-1V3c0-.55.45-1 1-1h3c0-1.11.89-2 2-2 1.11 0 2 .89 2 2h3c.55 0 1 .45 1 1v5h-1V5H3v9h10v-2zM4 4h8c0-
.55-.45-1-1-1h-1c-.55 0-1-.45-1-1s-.45-1-1-1-1 .45-1 1-.45 1-1 1H5c-.55 0-1 .45-1 1z/"/></svg>"'

🌍 Your Environment




     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/


Angular CLI: 13.3.9
Node: 16.14.2
Package Manager: npm 7.14.0
OS: win32 x64

Angular: 13.3.11
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router, service-worker

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1303.9
@angular-devkit/build-angular   13.3.9
@angular-devkit/core            13.3.9
@angular-devkit/schematics      13.3.9
@angular/cli                    13.3.9
@schematics/angular             13.3.9
rxjs                            7.5.6
typescript                      4.6.2

@alan-agius4 alan-agius4 self-assigned this Aug 4, 2022
alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue Aug 4, 2022
…scaped quotes in stylesheets

Previously, the RegExp didn't correctly handle cases where data URIs had escaped quotes like the below

```css
url("data:image/svg+xml;charset=utf-8,<svg width=/"16/" height=/"15/"></svg>")
```

Closes angular#23680
alan-agius4 added a commit to alan-agius4/angular-cli that referenced this issue Aug 4, 2022
…scaped quotes in stylesheets

Previously, the RegExp didn't correctly handle cases where data URIs had escaped quotes like the below

```css
url("data:image/svg+xml;charset=utf-8,<svg width=/"16/" height=/"15/"></svg>")
```

Closes angular#23680
dgp1130 pushed a commit that referenced this issue Aug 4, 2022
…scaped quotes in stylesheets

Previously, the RegExp didn't correctly handle cases where data URIs had escaped quotes like the below

```css
url("data:image/svg+xml;charset=utf-8,<svg width=/"16/" height=/"15/"></svg>")
```

Closes #23680

(cherry picked from commit 70bc354)
dgp1130 pushed a commit that referenced this issue Aug 4, 2022
…scaped quotes in stylesheets

Previously, the RegExp didn't correctly handle cases where data URIs had escaped quotes like the below

```css
url("data:image/svg+xml;charset=utf-8,<svg width=/"16/" height=/"15/"></svg>")
```

Closes #23680
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 4, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
2 participants