Pirsch-ignore atttribute not valid html

This attribute doesn’t seem to be valid html (validator.w3.org):

Outbound Links
Outbound Links

Probably class will be, so I’ll use that.

Maybe offer data-attributes which are valid html as a solution?

Yup, not valid, but browsers ignore unknown attributes, which is also part of the RFC I think.

Changing this to data-… would work, but we don’t want to make breaking changes if not necessary. Adding more options also inflates the script. I’m not really sure if we can or should resolve it.

Get the point regarding inflating. At least at a line to the documentation to inform people that the attribute is not valid html and using class is.

1 Like

I have the same problem with other JS libraries too, Kasper. Here are two StackOverflow posts about it. Adding data- in front would make it conform, but only to the point that you tell the validator to ignore the custom attribute. As long as it does not collide with other attributes, I can live with it.

1 Like

I’ll change it so that we support both, with and without the data- prefix.

I’ve added it to version 2.3. Please switch from “pirsch-ignore” to “data-pirsch-ignore” when it’s out :+1:

2 Likes

That is wonderful, you made at least two “HTML validator nerds” happy with that change. Thank you very much. :trophy:

1 Like