Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
HTML5 Syntax Checking doesn't work on some html5 elements #944
Problem is likely that our version of HTML Tidy is outdated. Or we need to default to using html5lib for syntax checking.
As a work around you can add the missing html5 elements true a config file, created a gist with the config file. If you safe this as
The lint errors are gone, yes---thank you @babobski . But I had already got the lint areas to go away temporarily switching to html5lib. I had wanted to go back to HTML Tidy to get the warnings back (see @babobski 's comment elsewhere, but unfortunately this config file doesn't update the warnings and gives me all sorts of inappropriate messages like
In other news, @babobski pointed out that I can use the
Things should go much smoother once we get the new version of HTML Tidy. Good luck, @Naatan !
So really, @Naatan , the only real option is for you to update Tidy. The config file, although nice, doesn't allow me to turn on warnings. And switching to html5lib doesn't allow me to turn on warnings.
Yes, i do
My point is that no one discovered until now that the HTML Tidy version is so out of date that it doesn't recognize
@mitchell-as Personally I think this isn't a bug but just a case of using the wrong syntax.
I had the discussion with @garretwilson about what is the correct syntax, I asked how to properly syntax you're xhtml5 files. Garret didn't came up with a solid reference how to syntax you're xhtml5 files, he gave me this explanation:
Because I wanted to be sure how to correctly syntax xhtml5 files, i went on a research.
When you look at the reference section of html5, you will see the a reference called polyglot.
So what is polyglot:
This document describes how to write xhtml5 markup what results in valid html5 and valid xml.
As I described above, Komodo is linting correct for html5 and xml if you don't drop a XML declaration in the document.
My research didn't stopped there, I went true the w3c specifications to find any reference to xhtml5.
So from my research i can conclude that there are no current specs(completed works) describing the xhtml5 syntax. The references to xhtml5 are shown without the XML declaration and in the polyglot markup this is forbidden.
Tell me again @babobski where you found some that said XHTML5 and "polyglot" are the same thing? Because they are not. In fact the reason it is called "polyglot" is because the document would be both acceptable XHTML5 or non-XML HTML5 (which is where the "poly" part comes in).
Since you are starting from the flawed premise that they are the same thing, then that throws off your conclusions:
Perhaps you are trying to say that Komodo is linting correct[ly] for polyglot markup. Perhaps it is; I haven't checked But that is only a subset of all XHTML5 documents.
So your first conclusion is wrong from the start, as you are conflating the two concepts.
I frankly don't even know what that sentence says semantically; it seems to be several sentences together, and I'm not clever enough to parse them all out.
The long and short of it: XHTML5 allows the XML declaration (but do not require it), even though polyglot documents prohibit it. If Komodo doesn't correctly lint a file containing an XML declaration, there are at least some XHTML5 documents Komodo does not correctly lint. (Note that I have made no assertions about whether Komodo correctly lints polyglot documents; I haven't tested this.)
I don't say they are the same,I'm saying there are currently no specs describing that the xml tag is allowed in xhtml5 and the only specs i found describing how to write valid xhtml5 is the polyglot markup.
I didn't find a spec that says that, i only found the polyglot syntax that doesn't allow the XML declaration (if you can proof me wrong you're welcome).
If you look at the answer in the discussion "Is XHTML5 dead or is it just an synonym of HTML5?", it is confirming what I'm saying:
There are currently no specs for a xhtml5 language, only the obsolete polyglot language.
If you use the (x)html5 validator and use this template:
<?xml version="1.0" encoding="utf-8"?> <!DOCTYPE html> <html xmlns="https://www.w3.org/1999/xhtml"> <head> <meta charset="utf-8" /> <title>Example XHTML5 document</title> </head> <body> </body> </html>
You will get the following errors and warnings:
And you're still not doing that.
I'm sharing this because i research about xhtml5 when I was in a previous discussion with you. And i wanted to share my findings on the xhtml5 because i still think the XML declaration doesn't belong there if you're validation for (x)html5 and komodo is linting correct for xhtml5 if you omit the XML declaration.
Yep I'm dutch, and my English is not always that great, also my dutch is terrible because I'm dyslexic (that mean's I'm more creative than pernickety). But I don't think you're that stupid that you don't understand what I'm trying to say.
At the end of the day, what you CAN and CANNOT do with a given spec is up to the linter. All we seek to facilitate is that the linter Komodo uses and supports allows you to configure it in the way that is relevant to the spec that you are using.
Put another way; we don't really care what the differences between 2 specs are, as long as our linter supports them. Now if a given spec really is deprecated and barely gets any use anymore then that may change things..
Either way, the todo for this ticket remains the same: Update HTML tidy to get better support for HTML specs.
@garretwilson I know you mean well, but the fact that your tone is too direct for a Dutchman is quite telling ;) I'd appreciate if you could try to formulate your messages with a friendlier tone.
Hey, @babobski . I confess I didn't even see your sentence above until just now. I just wanted to say that I in no way intended to disrespect your being Dutch or your being dyslexic---I wasn't aware of either when I wrote that stuff.
You say that you are more creative than pernickety. (Pernickety is a good word---I have never used it before!) I on the other hand am way more on the "pernickety" side---that's just how my brain is wired. So that means I excel it picking through and comprehending specifications, and I've implemented XML, HTML, HTTP, and other parsers from scratch. That's simply the sort of thing I'm good at.
But being "pernickety" if I'm not careful also makes me grumpy when I see so many tools that apparently ignore the specifications and just throw things together "good enough" so they work sometimes, even if they don't match the specifications. I'll try to work on that "negative tone", but I just wanted to let you know that nothing was personal and it just came from my being pernickety.
P.S. Thanks again for the great English word. I think I'll use it a lot now.