Re: Markup Validation for URLs with UTM

> On Dec 4, 2021, at 4:34 AM, Jens Oliver Meiert <jens@meiert.com> wrote:
> 
>> One area I cannot find help with is the way your validator handles URLs with UTM code. For example, placing the following URL in a link causes 4 Errors and 6 warning(s):
>> 
>> https://www.lps.upenn.edu/about/events/pre-health-post-baccalaureate-programs-virtual-information-session?utm_source=asda&utm_medium=email&utm_campaign=prehealth_asda_email
> 
> That link should not cause any problems in a standard HTML document, [...]

The OP (Lyons) doesn't mention it, but from the error message and HTML-email context, it seems likely the doc is declared as XHTML or HTML-4 (very common for HTML-email). The Validator is stricter for those doctypes, so the ampersands would need to be encoded as HTML entities. I.e.:

<a href="https://www.lps.upenn.edu/about/events/pre-health-post-baccalaureate-programs-virtual-information-session?utm_source=asda&amp;utm_medium=email&amp;utm_campaign=prehealth_asda_email">Test</a>

- Chuck

Received on Saturday, 4 December 2021 17:19:07 UTC