material-dokuwiki icon indicating copy to clipboard operation
material-dokuwiki copied to clipboard

Errors with the W3C validator : <button> inside <a> tags

Open mkrtchian opened this issue 3 years ago • 1 comments

When I try the code of a wiki page in the W3C HTML validator, it shows some errors about buttons in <a> tags :

The element button must not appear as a descendant of the a element.

For buttons like here.

We can probably remove the <button> tags to let only the wrapping <a> tags but I guess they add some styling from material CSS, so some changes should be also done about that to keep the current styling. I haven't tried to change this yet.

mkrtchian avatar Oct 10 '20 19:10 mkrtchian

Yes, this is an issue, mainly of semantic nature though, because it doesn't cause a problem in modern browsers.

I agree, that it would be better to only use <a> tags, but this would require porting a lot of styles from MDL. To be honest, I'm not sure if that's worth it.

A better solution might be using something such as upgradeDom to consistently update all components of the webpage to be inline with the MDL spec.

LeonStaufer avatar Oct 11 '20 09:10 LeonStaufer