Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Semantic markup warning #133

Closed
bjankord opened this issue Aug 17, 2015 · 2 comments
Closed

Semantic markup warning #133

bjankord opened this issue Aug 17, 2015 · 2 comments

Comments

@bjankord
Copy link

I've noticed the following error in places where we are using the element:

"Semantic markup should be used to mark emphasised or special text so that it can be programmatically determined."

Small is a valid HTML5 element, so I'm curious if this warning is accurate.

@luketw
Copy link
Member

luketw commented Aug 17, 2015

Hi Brett,

Those errors would safe to ignore for HTML5 documents, although I will leave the issue open because there is probably work that needs to be done down the track to silence that error if it sees a HTML5 doctype.

HTMLCS is currently a bit stuck as to what to do with these, because it currently does not read the doctype. In HTML 4.01 - and therefore, also, XHTML 1.0 - elements like "small", "b", "i" etc were defined as presentational elements, and the W3C saw it fit to push users towards usage of CSS for styling of these - and the use of "strong", "em" and so on to semantically mark up those bits that actually need emphasis. So tags like "small" were actually seen as deprecated, if still legally valid.

In HTML5 - probably to the W3C's initial chagrin, I suspect - these were redefined by WHATWG in sort-of semantic terms (eg. "small" is defined as for "side comments such as small print"), and therefore these are no longer "presentational" per se. Given this lack of doctype knowledge, HTMLCS is erring on... well, more the "XHTML 1.0" side of things at the moment, despite us knowing that those errors are inaccurate in HTML5. Was probably fair enough a couple of years ago when HTMLCS was first developed, but HTML5 has obviously been on a roll lately and that presumption is not as valid now.

So, HTMLCS probably needs the ability to read the doctype in JavaScript so as to determine which HTML version it's reading - which is definitely possible, but would not be supported in IE8 [which ignores the doctype entirely from memory]... which we still support, but not that I suspect that many developers would be using HTMLCS as part of testing that browser. Document fragments - like those that can be tested on the HTMLCS front page - also suffer from this, and what also think of documents written in XHTML5, which actually don't need a doctype at all? So perhaps there needs to be some sort of override switch available where the doctype can't be determined.

Thanks for your report and concern. :)

~ Luke

@MarcusMorba
Copy link

MarcusMorba commented Jan 25, 2017

There´s still a warning issue with <u>...</u> which is valid HTML5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants