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

The contents of links' href attributes are encoded #996

Open
DmitryEfimenko opened this issue Apr 26, 2023 · 3 comments
Open

The contents of links' href attributes are encoded #996

DmitryEfimenko opened this issue Apr 26, 2023 · 3 comments
Labels
bug Something isn't working external-dependency Process is blocked by external dependency

Comments

@DmitryEfimenko
Copy link

Describe the bug
When index.html file is updated, the & in the link's href attribute is updated to &

To Reproduce
Steps to reproduce the behavior:

  1. Ensure that your index.html file has:
    <link
       href="https://fonts.googleapis.com/css?family=Material+Icons|Roboto:wght@300;400;500&display=swap"
       rel="stylesheet"
    />
  2. Execute cli command npx pwa-asset-generator path\to\icon.png path\to\icons --index path\to\index.html
  3. Open index.html
  4. Observe the link got changed to:
    <link
       href="https://fonts.googleapis.com/css?family=Material+Icons|Roboto:wght@300;400;500&amp;display=swap"
       rel="stylesheet"
    />

Expected behavior
The & should not be encoded in href attributes.

If you navigate to both URLs, and compare contents, you'll see that the one that does not have encoding is the right one.

System (please complete the following information):

  • OS: windows 10
  • node version: v18.10.0
  • npm version: 8.19.2
  • cli version: 6.2.1
@DmitryEfimenko DmitryEfimenko added bug Something isn't working needs verification Bug needs to be verified with reproduction labels Apr 26, 2023
@atjn
Copy link
Collaborator

atjn commented Aug 25, 2024

I can reproduce this, it seems to be a bug in Cheerio.

@atjn atjn added external-dependency Process is blocked by external dependency and removed needs verification Bug needs to be verified with reproduction labels Aug 25, 2024
@atjn
Copy link
Collaborator

atjn commented Aug 25, 2024

I have opened an issue in Cheerio: cheeriojs/cheerio#4045

@atjn
Copy link
Collaborator

atjn commented Aug 25, 2024

One thing I just realized is that both links work correctly if you first load the HTML document in a browser. So this is not as severe as it may sound. But I still think it would be nice if the original links were kept.

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

No branches or pull requests

2 participants