Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

--html-keep-quotes, mixed single and double quotes in final output #670

Closed
dehghani-mehdi opened this issue Feb 10, 2024 · 2 comments
Closed

Comments

@dehghani-mehdi
Copy link

<!doctype html>
<html lang='en'>
    <head>
        <meta charset='utf-8'>
        <meta name='viewport' content='width=device-width, initial-scale=1'>
        <title>Bootstrap demo</title>
        <link href='https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css' rel='stylesheet' crossorigin='anonymous'>
    </head>
    <body>
        <h1>Hello, world!</h1>
        <script src='https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js' crossorigin='anonymous'></script>
    </body>
</html>

Running minify --type=html --html-keep-quotes --html-keep-end-tags --html-keep-document-tags will produce this:

<!doctype html><html lang='en'><head><meta charset='utf-8'><meta name='viewport' content="width=device-width,initial-scale=1"><title>Bootstrap demo</title>
<link href='https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css' rel='stylesheet' crossorigin='anonymous'></head><body><h1>Hello, world!</h1><script src='https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js' crossorigin='anonymous'></script></body></html>

As you can see there are some double quotes in the final output content="width=device-width,initial-scale=1", I couldn't find any option to tell minify to use only single quote (or double quote)

@tdewolff
Copy link
Owner

Using either single or double quotes doesn't matter in HTML, so you shouldn't have any problems with this. What use-case do you have?

Currently, --html-keep-quotes means it will not strip away quotes but it will still optimize the content and use either single or double quotes, whichever is shorter. I can understand that it could also mean: keep the original quotes, in which case it should not change to single/double quotes and omit optimizing the attribute value w.r.t. quote usage. But again, why is this causing problems for you?

@dehghani-mehdi
Copy link
Author

It broke all my unit tests, I could replace all double quotes with single ones before running my tests, but I think you should consider fixing this.

kodiakhq bot referenced this issue in cloudquery/codegen Mar 1, 2024
)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [github.com/tdewolff/minify/v2](https://github.com/tdewolff/minify) | indirect | patch | `v2.20.16` -> `v2.20.18` |

---

> [!WARNING]
> Some dependencies could not be looked up. Check the Dependency Dashboard for more information.

---

### Release Notes

<details>
<summary>tdewolff/minify (github.com/tdewolff/minify/v2)</summary>

### [`v2.20.18`](https://github.com/tdewolff/minify/releases/tag/v2.20.18)

[Compare Source](https://github.com/tdewolff/minify/compare/v2.20.17...v2.20.18)

-   [cmd: fix --watch functionality,](https://github.com/tdewolff/minify/commit/1508f98414a1b1398639d8fe38816e99da51859e) [fixes](https://github.com/tdewolff/minify/commit/1508f98414a1b1398639d8fe38816e99da51859e) [https://github.com/tdewolff/minify/issues/672](https://github.com/tdewolff/minify/issues/672)

### [`v2.20.17`](https://github.com/tdewolff/minify/releases/tag/v2.20.17)

[Compare Source](https://github.com/tdewolff/minify/compare/v2.20.16...v2.20.17)

-   [cmd: output statistics now have fixed length, removing dependency on go-humanize](https://github.com/tdewolff/minify/commit/f27fd34c5315594bcb80c2d3f75b617925415d32)
-   [cmd: choose newest atime/mtime to preserve timestamps when using --bundle; allow setting preserve with --bundle; add warnings when ownership/permissions differ between input files when using --bundle; see](https://github.com/tdewolff/minify/commit/6b9175d2baee924112fab94ff601547d7fb99bbf) [https://github.com/tdewolff/minify/issues/671](https://github.com/tdewolff/minify/issues/671)
-   [cmd: don't preserve parent directories for --bundle, see](https://github.com/tdewolff/minify/commit/c754bf52bd6cf6ea65ce52d88204e37aebd0228d) [https://github.com/tdewolff/minify/issues/671](https://github.com/tdewolff/minify/issues/671)
-   [HTML: keep original attribute quote for all attributes,](https://github.com/tdewolff/minify/commit/a72c2ec610988130ae82e34cea4466a06a16457c) [fixes](https://github.com/tdewolff/minify/commit/a72c2ec610988130ae82e34cea4466a06a16457c) [https://github.com/tdewolff/minify/issues/670](https://github.com/tdewolff/minify/issues/670)
-   [JS: fix precedence of OptionalChaining expression](https://github.com/tdewolff/parse/commit/3b2a162fdb5403e0e8fd3e120da653375f970265)
-   [JS: fix parsing of 'export default expr' where expression can only be an assignment expression](https://github.com/tdewolff/parse/commit/3381c44c56c03890f434f45d0ecca109ffe6a24b)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "before 4am on the first day of the month" (UTC), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4yMjEuMCIsInVwZGF0ZWRJblZlciI6IjM3LjIyMS4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9-->
kodiakhq bot referenced this issue in cloudquery/filetypes Mar 1, 2024
)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [github.com/tdewolff/minify/v2](https://github.com/tdewolff/minify) | indirect | patch | `v2.20.16` -> `v2.20.18` |

---

> [!WARNING]
> Some dependencies could not be looked up. Check the Dependency Dashboard for more information.

---

### Release Notes

<details>
<summary>tdewolff/minify (github.com/tdewolff/minify/v2)</summary>

### [`v2.20.18`](https://github.com/tdewolff/minify/releases/tag/v2.20.18)

[Compare Source](https://github.com/tdewolff/minify/compare/v2.20.17...v2.20.18)

-   [cmd: fix --watch functionality,](https://github.com/tdewolff/minify/commit/1508f98414a1b1398639d8fe38816e99da51859e) [fixes](https://github.com/tdewolff/minify/commit/1508f98414a1b1398639d8fe38816e99da51859e) [https://github.com/tdewolff/minify/issues/672](https://github.com/tdewolff/minify/issues/672)

### [`v2.20.17`](https://github.com/tdewolff/minify/releases/tag/v2.20.17)

[Compare Source](https://github.com/tdewolff/minify/compare/v2.20.16...v2.20.17)

-   [cmd: output statistics now have fixed length, removing dependency on go-humanize](https://github.com/tdewolff/minify/commit/f27fd34c5315594bcb80c2d3f75b617925415d32)
-   [cmd: choose newest atime/mtime to preserve timestamps when using --bundle; allow setting preserve with --bundle; add warnings when ownership/permissions differ between input files when using --bundle; see](https://github.com/tdewolff/minify/commit/6b9175d2baee924112fab94ff601547d7fb99bbf) [https://github.com/tdewolff/minify/issues/671](https://github.com/tdewolff/minify/issues/671)
-   [cmd: don't preserve parent directories for --bundle, see](https://github.com/tdewolff/minify/commit/c754bf52bd6cf6ea65ce52d88204e37aebd0228d) [https://github.com/tdewolff/minify/issues/671](https://github.com/tdewolff/minify/issues/671)
-   [HTML: keep original attribute quote for all attributes,](https://github.com/tdewolff/minify/commit/a72c2ec610988130ae82e34cea4466a06a16457c) [fixes](https://github.com/tdewolff/minify/commit/a72c2ec610988130ae82e34cea4466a06a16457c) [https://github.com/tdewolff/minify/issues/670](https://github.com/tdewolff/minify/issues/670)
-   [JS: fix precedence of OptionalChaining expression](https://github.com/tdewolff/parse/commit/3b2a162fdb5403e0e8fd3e120da653375f970265)
-   [JS: fix parsing of 'export default expr' where expression can only be an assignment expression](https://github.com/tdewolff/parse/commit/3381c44c56c03890f434f45d0ecca109ffe6a24b)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "before 4am on the first day of the month" (UTC), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4yMjEuMCIsInVwZGF0ZWRJblZlciI6IjM3LjIyMS4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9-->
kodiakhq bot referenced this issue in cloudquery/plugin-pb-go Mar 1, 2024
)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [github.com/tdewolff/minify/v2](https://github.com/tdewolff/minify) | indirect | patch | `v2.20.16` -> `v2.20.18` |

---

> [!WARNING]
> Some dependencies could not be looked up. Check the Dependency Dashboard for more information.

---

### Release Notes

<details>
<summary>tdewolff/minify (github.com/tdewolff/minify/v2)</summary>

### [`v2.20.18`](https://github.com/tdewolff/minify/releases/tag/v2.20.18)

[Compare Source](https://github.com/tdewolff/minify/compare/v2.20.17...v2.20.18)

-   [cmd: fix --watch functionality,](https://github.com/tdewolff/minify/commit/1508f98414a1b1398639d8fe38816e99da51859e) [fixes](https://github.com/tdewolff/minify/commit/1508f98414a1b1398639d8fe38816e99da51859e) [https://github.com/tdewolff/minify/issues/672](https://github.com/tdewolff/minify/issues/672)

### [`v2.20.17`](https://github.com/tdewolff/minify/releases/tag/v2.20.17)

[Compare Source](https://github.com/tdewolff/minify/compare/v2.20.16...v2.20.17)

-   [cmd: output statistics now have fixed length, removing dependency on go-humanize](https://github.com/tdewolff/minify/commit/f27fd34c5315594bcb80c2d3f75b617925415d32)
-   [cmd: choose newest atime/mtime to preserve timestamps when using --bundle; allow setting preserve with --bundle; add warnings when ownership/permissions differ between input files when using --bundle; see](https://github.com/tdewolff/minify/commit/6b9175d2baee924112fab94ff601547d7fb99bbf) [https://github.com/tdewolff/minify/issues/671](https://github.com/tdewolff/minify/issues/671)
-   [cmd: don't preserve parent directories for --bundle, see](https://github.com/tdewolff/minify/commit/c754bf52bd6cf6ea65ce52d88204e37aebd0228d) [https://github.com/tdewolff/minify/issues/671](https://github.com/tdewolff/minify/issues/671)
-   [HTML: keep original attribute quote for all attributes,](https://github.com/tdewolff/minify/commit/a72c2ec610988130ae82e34cea4466a06a16457c) [fixes](https://github.com/tdewolff/minify/commit/a72c2ec610988130ae82e34cea4466a06a16457c) [https://github.com/tdewolff/minify/issues/670](https://github.com/tdewolff/minify/issues/670)
-   [JS: fix precedence of OptionalChaining expression](https://github.com/tdewolff/parse/commit/3b2a162fdb5403e0e8fd3e120da653375f970265)
-   [JS: fix parsing of 'export default expr' where expression can only be an assignment expression](https://github.com/tdewolff/parse/commit/3381c44c56c03890f434f45d0ecca109ffe6a24b)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "before 4am on the first day of the month" (UTC), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4yMjEuMCIsInVwZGF0ZWRJblZlciI6IjM3LjIyMS4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9-->
kodiakhq bot referenced this issue in cloudquery/plugin-sdk Mar 1, 2024
…1546)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [github.com/tdewolff/minify/v2](https://github.com/tdewolff/minify) | indirect | patch | `v2.20.16` -> `v2.20.18` |

---

> [!WARNING]
> Some dependencies could not be looked up. Check the Dependency Dashboard for more information.

---

### Release Notes

<details>
<summary>tdewolff/minify (github.com/tdewolff/minify/v2)</summary>

### [`v2.20.18`](https://github.com/tdewolff/minify/releases/tag/v2.20.18)

[Compare Source](https://github.com/tdewolff/minify/compare/v2.20.17...v2.20.18)

-   [cmd: fix --watch functionality,](https://github.com/tdewolff/minify/commit/1508f98414a1b1398639d8fe38816e99da51859e) [fixes](https://github.com/tdewolff/minify/commit/1508f98414a1b1398639d8fe38816e99da51859e) [https://github.com/tdewolff/minify/issues/672](https://github.com/tdewolff/minify/issues/672)

### [`v2.20.17`](https://github.com/tdewolff/minify/releases/tag/v2.20.17)

[Compare Source](https://github.com/tdewolff/minify/compare/v2.20.16...v2.20.17)

-   [cmd: output statistics now have fixed length, removing dependency on go-humanize](https://github.com/tdewolff/minify/commit/f27fd34c5315594bcb80c2d3f75b617925415d32)
-   [cmd: choose newest atime/mtime to preserve timestamps when using --bundle; allow setting preserve with --bundle; add warnings when ownership/permissions differ between input files when using --bundle; see](https://github.com/tdewolff/minify/commit/6b9175d2baee924112fab94ff601547d7fb99bbf) [https://github.com/tdewolff/minify/issues/671](https://github.com/tdewolff/minify/issues/671)
-   [cmd: don't preserve parent directories for --bundle, see](https://github.com/tdewolff/minify/commit/c754bf52bd6cf6ea65ce52d88204e37aebd0228d) [https://github.com/tdewolff/minify/issues/671](https://github.com/tdewolff/minify/issues/671)
-   [HTML: keep original attribute quote for all attributes,](https://github.com/tdewolff/minify/commit/a72c2ec610988130ae82e34cea4466a06a16457c) [fixes](https://github.com/tdewolff/minify/commit/a72c2ec610988130ae82e34cea4466a06a16457c) [https://github.com/tdewolff/minify/issues/670](https://github.com/tdewolff/minify/issues/670)
-   [JS: fix precedence of OptionalChaining expression](https://github.com/tdewolff/parse/commit/3b2a162fdb5403e0e8fd3e120da653375f970265)
-   [JS: fix parsing of 'export default expr' where expression can only be an assignment expression](https://github.com/tdewolff/parse/commit/3381c44c56c03890f434f45d0ecca109ffe6a24b)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "before 4am on the first day of the month" (UTC), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4yMjEuMCIsInVwZGF0ZWRJblZlciI6IjM3LjIyMS4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9-->
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants