code-syntax-block icon indicating copy to clipboard operation
code-syntax-block copied to clipboard

Bad value apacheconf for attribute lang on element code (invalid lang attribute)

Open oldrup opened this issue 4 years ago • 2 comments

Hey! What a great plugin. I especially love how it just extends the existing code block, meaning you can disable it should you need it, without loosing content..

A little issue though. The use of the "lang" attribute, for anything else but, eh, spoken languages (en-us, es, and so on) triggers warnings both when validating html and validating accessibility:

image

image

Mozillas docs on lang attribute

Is there any way the code could be change to used data attributes or detect the chosen language base on the class instead? That would probably result in valid html5 output...

Kind regards Bjarne

oldrup avatar Jun 07 '21 08:06 oldrup

More complaining - in this case by Google Lighthouse checks: :D

image

oldrup avatar Jun 07 '21 09:06 oldrup

I have an open PR #85 that attempts to fix this, however there was some transformation issues for existing content to the new format. I will attempt again with the newer updates to WordPress/Gutenberg and I might be able to get it in.

As an aside, I think it rather narrow scope of the standards to not consider programming languages valid languages.

mkaz avatar Jul 14 '21 00:07 mkaz