-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
HTML5 validation warning on "style" #5146
Comments
I think I agree. The The namespace and xml:lang stuff makes the file also a valid XHTML document, which is nice for some use-cases. See #3473 |
@mb21 you've done well to catch the relevant history of the project here... @crystalfp, as @mb21 points to, I managed to persuade @jgm to use a slightly stricter standard than HTML (5). That is, the use polyglot markup. Essentially that entails using HTML (5) with a XHTML conforming syntax (a syntax that is XML valid) and a small number of additional restrictions. That results in a markup that is consistent with the HTML (5) spec thereby facilitating an easy switching between serving a web page as "application/xhtml+xml" or "text/html" MIME type and having it render, in the browser, identically. So on the assumption that polyglot markup continues to be our standard... On the html element, default namespace attribute: this is required under polyglot https://www.w3.org/TR/html-polyglot/#element-level-namespaces
That is also exemplified in the minimal example, https://www.w3.org/TR/html-polyglot/#minimal-polyglot-html-document On the html element, language attributes there are two relevant rules. Firstly, If you specify the language you MUST use lang and xml:lang with identical values. http://www.w3.org/TR/html-polyglot/#language-attributes Secondly, http://www.w3.org/TR/html-polyglot/#language-attributes
And by a very extraordinary coincidence I was today looking at the
... and, as @mb21 has already established, polyglot examples drop it from the style block. So it seems we can be confident to say that, in a style block, It is strange the validation warning is stronger than either standard suggests, in claiming it SHOULD be dropped. However I think it would be good to take our cue from the validation message by dropping Whether type="text/css"` should be removed from the link element, however, would be a separate matter. I hope to do the relevant reading on that soon ™ and report back. Anyone else, of course, could beat me to the punch on that. It might be worth settling that issue too before closing this issue (or creating a pull request). Edit:
to
|
I was not aware of this polyglot thing. So seems my best option is to edit the template file, reduce it to pure HTML5 and use it during conversion. |
It's quite useful to ensure that the pandoc output is
both valid XML and valid HTML5, which is what polyglot
gives you. (For one thing, epub3 requires XHTML5.)
And there's no cost to this, as long as it's valid HTML5.
We should take the type attribute off the style tag,
though.
|
OK, understand the rationale for polyglot. Thanks for fixing the style issue. |
Seems the text/css isn't really needed in link either: |
TL;DR:After further research I can verify the decisions already made are likely to be the right things to do. The commit 'Remove unnecessary type="text/css" on style and link for HTML5' looks correct. For completeness I'll detail the following points:
Link element and
|
Validating Pandoc generated HTML5 page elicit warning during validation.
The source (bug.md):
The build command (bug.sh):
The validation generates a warning: "The type attribute for the style element is not needed and should be omitted." Also not sure that defining the namespace and xml:lang in the header is needed for HTML5
Is generating the template
pandoc -D html5
, modifying and using it the only workaround?Thanks for clarifying!
mario
pandoc.exe 2.4 (32 bits) on windows10 64bits
The text was updated successfully, but these errors were encountered: