{"action":"created","issue":{"url":"https://api.github.com/repos/squizlabs/HTML_CodeSniffer/issues/137","repository_url":"https://api.github.com/repos/squizlabs/HTML_CodeSniffer","labels_url":"https://api.github.com/repos/squizlabs/HTML_CodeSniffer/issues/137/labels{/name}","comments_url":"https://api.github.com/repos/squizlabs/HTML_CodeSniffer/issues/137/comments","events_url":"https://api.github.com/repos/squizlabs/HTML_CodeSniffer/issues/137/events","html_url":"https://github.com/squizlabs/HTML_CodeSniffer/issues/137","id":114521816,"number":137,"title":"Offer a way to set the flavour of HTML to test with","user":{"login":"lwright-sq","id":997657,"avatar_url":"https://avatars.githubusercontent.com/u/997657?v=3","gravatar_id":"","url":"https://api.github.com/users/lwright-sq","html_url":"https://github.com/lwright-sq","followers_url":"https://api.github.com/users/lwright-sq/followers","following_url":"https://api.github.com/users/lwright-sq/following{/other_user}","gists_url":"https://api.github.com/users/lwright-sq/gists{/gist_id}","starred_url":"https://api.github.com/users/lwright-sq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lwright-sq/subscriptions","organizations_url":"https://api.github.com/users/lwright-sq/orgs","repos_url":"https://api.github.com/users/lwright-sq/repos","events_url":"https://api.github.com/users/lwright-sq/events{/privacy}","received_events_url":"https://api.github.com/users/lwright-sq/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/squizlabs/HTML_CodeSniffer/labels/Enhancement","name":"Enhancement","color":"6c6998"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-11-02T04:14:40Z","updated_at":"2016-02-04T16:45:36Z","closed_at":null,"body":"As it stands, HTMLCS does not make any assumptions about the flavour of HTML one is running, because for the most part it does not matter - the DOM will still be what it is regardless of whether it is HTML, XHTML or whatever.\r\n\r\nBut there are instances where this matters, such as found at #133. Going between HTML 4.01 (including XHTML 1.0) and HTML5 (or WHATWG HTML), there have been some interpretation changes for certain tags. Most notably, presentation tags like \"b\", \"i\", and \"small\" are defined in a pseudo-semantic way in HTML5, and arguably shouldn't be throwing the same messages there as in HTML 4/XHTML 1. If HTMLCS eventually extends to raw HTML-level testing at some point, then whether it is defined as HTML or XHTML would make a difference in that too,.\r\n\r\nFull documents should default to their DOCTYPE - this is available in a JavaScript property, except in earlier versions of IE (including IE8) which consider the DOCTYPE a comment (but may still be able to be parsed). But what's even more of a spanner in the works is, XHTML5 (ie. HTML 5's XML serialisation) recommends no DOCTYPE at all, making detection purely via doctype impossible. So there should still be some kind of override even for full documents, with a warning similar to what the W3C's HTML checker gives when overriding.\r\n\r\nDocument fragments would also need this override, although no extra messages would be required apart from a warning that document fragments cannot be conformant in and of themselves."},"comment":{"url":"https://api.github.com/repos/squizlabs/HTML_CodeSniffer/issues/comments/179939120","html_url":"https://github.com/squizlabs/HTML_CodeSniffer/issues/137#issuecomment-179939120","issue_url":"https://api.github.com/repos/squizlabs/HTML_CodeSniffer/issues/137","id":179939120,"user":{"login":"andrewholgate","id":3862180,"avatar_url":"https://avatars.githubusercontent.com/u/3862180?v=3","gravatar_id":"","url":"https://api.github.com/users/andrewholgate","html_url":"https://github.com/andrewholgate","followers_url":"https://api.github.com/users/andrewholgate/followers","following_url":"https://api.github.com/users/andrewholgate/following{/other_user}","gists_url":"https://api.github.com/users/andrewholgate/gists{/gist_id}","starred_url":"https://api.github.com/users/andrewholgate/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrewholgate/subscriptions","organizations_url":"https://api.github.com/users/andrewholgate/orgs","repos_url":"https://api.github.com/users/andrewholgate/repos","events_url":"https://api.github.com/users/andrewholgate/events{/privacy}","received_events_url":"https://api.github.com/users/andrewholgate/received_events","type":"User","site_admin":false},"created_at":"2016-02-04T16:45:36Z","updated_at":"2016-02-04T16:45:36Z","body":":+1:  We've stumbled into this issue as well.\r\n\r\nAny hints as to the architectural direction to take to achieve this within the project? It would be useful to hear from the maintainers before so that we can help provide a workable patch."}}