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

Prevent of replacing & with & #176

Open
sepehr-davarnia opened this issue Jan 21, 2025 · 5 comments
Open

Prevent of replacing & with & #176

sepehr-davarnia opened this issue Jan 21, 2025 · 5 comments

Comments

@sepehr-davarnia
Copy link

sepehr-davarnia commented Jan 21, 2025

Hi
I am minifying my HTML code.
The library is escaping & char in tags, a problem in canonical tags.
How can I disable this behavior in link tags?

ex.
<link rel=canonical href="[DOMAIN]/store/accessories/headphones&headsets">

is being converted to

<link rel=canonical href=[DOMAIN]/store/accessories/headphones&amp;headsets>

@Taritsyn
Copy link
Owner

Hello!

There is no such possibility yet. When I have free time, I will try to implement the corresponding option.

In any case, this is valid HTML code. You can check it using the W3C Markup Validation Service.

@Taritsyn
Copy link
Owner

As a temporary solution, you can wrap this tag in a ignoring comment tags:

<!--wmm:ignore--><link rel=canonical href="[DOMAIN]/store/accessories/headphones&headsets"><!--/wmm:ignore-->

@sepehr-davarnia
Copy link
Author

Hello!

There is no such possibility yet. When I have free time, I will try to implement the corresponding option.

In any case, this is valid HTML code. You can check it using the W3C Markup Validation Service.

Yes this is correct HTML code but for canonical URL tags and SEO manner exact string comparison is required.

@sepehr-davarnia
Copy link
Author

It worked and the problem was solved.
I thank you for your quick response.
And this is the website you can put it in your list ❤
https://www.apple-nic.com

As a temporary solution, you can wrap this tag in a ignoring comment tags:

@Taritsyn
Copy link
Owner

Hello, Sepehr!

I added a website to the list.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants