vite
vite copied to clipboard
fix(assets): avoid splitting `,` inside base64 value of `srcset` attribute
fixes #15419
Description
As mentioned in the issue, when parsing srcset
, the ,
inside base64 value was getting split and joined again, breaking the base64 encoding.
The comment of splitSrcSet
says that it is handling "data:..."
case. But RE itself is only catching single or double quotes. I added additional RE logic to capture the whole base64 values.
Additional context
What is the purpose of this pull request?
- [x] Bug fix
- [ ] New Feature
- [ ] Documentation update
- [ ] Other
Before submitting the PR, please make sure you do the following
- [x] Read the Contributing Guidelines, especially the Pull Request Guidelines.
- [x] Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
- [x] Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g.
fixes #123
). - [x] Update the corresponding documentation if needed.
- [x] Ideally, include relevant tests that fail without this PR but pass with it.
Run & review this pull request in StackBlitz Codeflow.