Ampersands in hyperlinks trigger W3C validation check

I have a problem. I encode code that is compliant with standard standards only so that it fails due to ampersands in some hyperlinks.

Does anyone know of a job or hack it.

thank

+3
source share
4 answers

You must encode hyperlinks for the URL , so all characters are converted to the actual ASCII format and do not contain any (X) HTML entities.

For C # use HttpUtility.UrlEncode, for PHP urlencode, for JavaScript encodeURI, etc. Finding the right method for the language you are using does not have to be so complicated.

+2

, , , - .

Unescaped URL- ( - , HTML-!) ", ".

&, , .

+12

Have you made them in such links?

&
+5
source

CDATA does wonders where you have it and in javascript lines ..

-1
source

Source: https://habr.com/ru/post/1737751/


All Articles