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

Does not work with urls encoded in base64 or svg #976

Closed
lsroman opened this issue Jul 11, 2023 · 1 comment · Fixed by #985
Closed

Does not work with urls encoded in base64 or svg #976

lsroman opened this issue Jul 11, 2023 · 1 comment · Fixed by #985
Labels
bug Something isn't working

Comments

@lsroman
Copy link

lsroman commented Jul 11, 2023

Describe the bug
happy-dom does not work with urls encoded in base64 or svg((

To Reproduce
Steps to reproduce the behavior:

  1. Create test.js file
  2. Copy this code
const { Window } = require('happy-dom');
const window = new Window();
const document = window.document;
const _tmp = document.createElement('div');
_tmp.style.setProperty('--test_1', "url(data:image/svg+xml;base64,TEST)");
_tmp.style.backgroundImage = "url(data:image/svg+xml;base64,TEST)"
console.log(_tmp.outerHTML);
  1. Run node test.js
  2. See console <div style="--test_1: url(data;"></div>

Expected behavior
<div style="--test_1: url(data:image/svg+xml;base64,TEST); background-image: url(data:image/svg+xml;base64,TEST)"></div>

Additional context
The problem here is because of the primitive cssText parsing.

@lsroman lsroman added the bug Something isn't working label Jul 11, 2023
malko added a commit to malko/happy-dom that referenced this issue Jul 13, 2023
malko added a commit to malko/happy-dom that referenced this issue Jul 13, 2023
malko added a commit to malko/happy-dom that referenced this issue Jul 13, 2023
malko added a commit to malko/happy-dom that referenced this issue Jul 13, 2023
capricorn86 added a commit to malko/happy-dom that referenced this issue Jul 13, 2023
malko added a commit to malko/happy-dom that referenced this issue Jul 17, 2023
malko added a commit to malko/happy-dom that referenced this issue Jul 17, 2023
capricorn86 added a commit to malko/happy-dom that referenced this issue Jul 17, 2023
capricorn86 added a commit that referenced this issue Jul 17, 2023
#976@minor Fix incorrect comma split on some css properties
@capricorn86
Copy link
Owner

Thank you @lsroman for reporting! 🙂

Big thanks to @malko for your contribution! 🌟

You can read more about the release here:
https://github.com/capricorn86/happy-dom/releases/tag/v10.5.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants