WebMarkupMin icon indicating copy to clipboard operation
WebMarkupMin copied to clipboard

Prevent of replacing & with &

Open sepehr-davarnia opened this issue 1 year ago • 5 comments

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>

sepehr-davarnia avatar Jan 21 '25 15:01 sepehr-davarnia

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 avatar Jan 21 '25 16:01 Taritsyn

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-->

Taritsyn avatar Jan 21 '25 16:01 Taritsyn

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 avatar Jan 21 '25 20:01 sepehr-davarnia

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:

sepehr-davarnia avatar Jan 21 '25 20:01 sepehr-davarnia

Hello, Sepehr!

I added a website to the list.

Taritsyn avatar Jan 22 '25 07:01 Taritsyn