Muhammad Nouman Khalid Muhammad Nouman Khalid - 4 months ago 16
HTML Question

Replaced & with & W3C validator Still Showing Error

I'm trying to fix w3 validator based errors on my site but i'm shocked when i see this error


Error: & did not start a character reference. (& probably should have been escaped as &.)


I'm using
&
as a replaced tag with
&
in site HTML. So why w3c validator showing errors to replace
&
with
&
because i already done it.

Can anyone help this issue ?

Reference URL: https://validator.w3.org/nu/?doc=http%3A%2F%2Fwww.urgentfiles.com%2F

Answer

In all of those validation errors (from number 6 to 49), the ampersand is not necessary because you are passing a unique parameter.

<a href='//www.urgentfiles.com/search/label/Action?max-results=6'>
    Action
</a>

In cases with a URL containing two or more parameters, you need a double escape like &amp;amp; to correct the issue. For example.

<a href='//www.urgentfiles.com/search/label/Action?max-results=6&amp;amp;other-param=demo'>
    Action
</a>