pandoc/test
John Luke Bentley 07d51d9e30 Make default.html5 polyglot markup conformant. (#3473)
Polyglot markup is HTML5 that is also valid XHTML. See
<https://www.w3.org/TR/html-polyglot>.  With this change, pandoc's
html5 writer creates HTML that is both valid HTML5 and valid XHTML.
See jgm/pandoc-templates#237 for prior discussion.

* Add xml namespace to `<html>` element.
* Make all `<meta>` elements self closing.
  See <https://www.w3.org/TR/html-polyglot/#empty-elements>.
* Add `xml:lang` attribute on `<html>` element, defaulting to blank, and
  always include `lang` attribute, even when blank.  See
  <https://www.w3.org/TR/html-polyglot/#language-attributes>.
* Update test files for template changes.

The key justification for having language values default to blank: it
turns out the HTML5 spec requires it (as I read it).  Under
[the HTML5 spec, section "3.2.5.3. The lang and xml:lang
attributes"](https://www.w3.org/TR/html/dom.html#the-lang-and-xmllang-attributes),
providing attributes with blank contents both:

    * Has meaning, "unknown", and
    * Is a MUST (written as "must") if a language value is not provided ...

> The lang attribute (in no namespace) specifies the primary language
> for the element's contents and for any of the element's attributes that
> contain text. Its value must be a valid BCP 47 language tag, or the
> empty string. Setting the attribute to the empty string indicates that
> the primary language is unknown.

In short, it seems that where a language value is not provided then a
blank value MUST be provided for Polyglot Markup conformance, because
the HTML5 spec stipulates a "must". So although the Polyglot Markup spec
is unclear on this issue it would seem that if it was correctly written,
it would therefore require blank attributes.

Further justifications are found at
https://github.com/jgm/pandoc-templates/issues/237#issuecomment-275584181
(but the HTML5 spec justification given above would seem to be the
clincher).

In addition to having lang-values-default-to-blank I recommend that, when an
author does not provide a lang value, then upon on pandoc command execution
a warning message like the following be provided:

> Polyglot markup stipulates that 'The root element SHOULD always specify
> the language'. It is therefore recommended you specify a language value in
> your source document. See
> <https://www.w3.org/International/articles/language-tags/> for valid
> language values.
2017-03-04 10:08:38 +01:00
..
command OpenDocument writer: fixed dropped elements in some ordered lists. 2017-03-03 22:48:37 +01:00
docx Moved tests/ -> test/. 2017-02-04 12:56:30 +01:00
epub Moved tests/ -> test/. 2017-02-04 12:56:30 +01:00
fb2 Moved tests/ -> test/. 2017-02-04 12:56:30 +01:00
media Moved tests/ -> test/. 2017-02-04 12:56:30 +01:00
odt Moved tests/ -> test/. 2017-02-04 12:56:30 +01:00
Tests LaTeX writer: always add hypertarget when there's a non-empty identifier. 2017-03-01 21:38:28 +01:00
bodybg.gif Moved tests/ -> test/. 2017-02-04 12:56:30 +01:00
docbook-reader.docbook Moved tests/ -> test/. 2017-02-04 12:56:30 +01:00
docbook-reader.native Moved tests/ -> test/. 2017-02-04 12:56:30 +01:00
docbook-xref.docbook Moved tests/ -> test/. 2017-02-04 12:56:30 +01:00
docbook-xref.native Moved tests/ -> test/. 2017-02-04 12:56:30 +01:00
dokuwiki_external_images.dokuwiki Moved tests/ -> test/. 2017-02-04 12:56:30 +01:00
dokuwiki_external_images.native Moved tests/ -> test/. 2017-02-04 12:56:30 +01:00
dokuwiki_inline_formatting.dokuwiki Moved tests/ -> test/. 2017-02-04 12:56:30 +01:00
dokuwiki_inline_formatting.native Moved tests/ -> test/. 2017-02-04 12:56:30 +01:00
dokuwiki_multiblock_table.dokuwiki Moved tests/ -> test/. 2017-02-04 12:56:30 +01:00
dokuwiki_multiblock_table.native Moved tests/ -> test/. 2017-02-04 12:56:30 +01:00
haddock-reader.haddock Moved tests/ -> test/. 2017-02-04 12:56:30 +01:00
haddock-reader.native Moved tests/ -> test/. 2017-02-04 12:56:30 +01:00
html-reader.html Moved tests/ -> test/. 2017-02-04 12:56:30 +01:00
html-reader.native Moved tests/ -> test/. 2017-02-04 12:56:30 +01:00
insert Moved tests/ -> test/. 2017-02-04 12:56:30 +01:00
lalune.jpg Moved tests/ -> test/. 2017-02-04 12:56:30 +01:00
latex-reader.latex Moved tests/ -> test/. 2017-02-04 12:56:30 +01:00
latex-reader.native When parsing raw LaTeX commands, include trailing space. 2017-02-22 21:15:25 +01:00
lhs-test-markdown.native Moved tests/ -> test/. 2017-02-04 12:56:30 +01:00
lhs-test.fragment.html+lhs Moved tests/ -> test/. 2017-02-04 12:56:30 +01:00
lhs-test.html Make default.html5 polyglot markup conformant. (#3473) 2017-03-04 10:08:38 +01:00
lhs-test.html+lhs Make default.html5 polyglot markup conformant. (#3473) 2017-03-04 10:08:38 +01:00
lhs-test.latex LaTeX writer: always add hypertarget when there's a non-empty identifier. 2017-03-01 21:38:28 +01:00
lhs-test.latex+lhs LaTeX writer: always add hypertarget when there's a non-empty identifier. 2017-03-01 21:38:28 +01:00
lhs-test.markdown Moved tests/ -> test/. 2017-02-04 12:56:30 +01:00
lhs-test.markdown+lhs Moved tests/ -> test/. 2017-02-04 12:56:30 +01:00
lhs-test.native Moved tests/ -> test/. 2017-02-04 12:56:30 +01:00
lhs-test.rst Moved tests/ -> test/. 2017-02-04 12:56:30 +01:00
lhs-test.rst+lhs Moved tests/ -> test/. 2017-02-04 12:56:30 +01:00
markdown-citations.native Moved tests/ -> test/. 2017-02-04 12:56:30 +01:00
markdown-citations.txt Moved tests/ -> test/. 2017-02-04 12:56:30 +01:00
markdown-reader-more.native Moved tests/ -> test/. 2017-02-04 12:56:30 +01:00
markdown-reader-more.txt Moved tests/ -> test/. 2017-02-04 12:56:30 +01:00
mediawiki-reader.native Moved tests/ -> test/. 2017-02-04 12:56:30 +01:00
mediawiki-reader.wiki Moved tests/ -> test/. 2017-02-04 12:56:30 +01:00
movie.jpg Moved tests/ -> test/. 2017-02-04 12:56:30 +01:00
opml-reader.native Moved tests/ -> test/. 2017-02-04 12:56:30 +01:00
opml-reader.opml Moved tests/ -> test/. 2017-02-04 12:56:30 +01:00
pipe-tables.native Moved tests/ -> test/. 2017-02-04 12:56:30 +01:00
pipe-tables.txt Moved tests/ -> test/. 2017-02-04 12:56:30 +01:00
rst-reader.native RST reader: support scale and align attributes of images. 2017-02-26 23:40:31 +01:00
rst-reader.rst Moved tests/ -> test/. 2017-02-04 12:56:30 +01:00
s5-basic.html Moved tests/ -> test/. 2017-02-04 12:56:30 +01:00
s5-fancy.html Moved tests/ -> test/. 2017-02-04 12:56:30 +01:00
s5-fragment.html Moved tests/ -> test/. 2017-02-04 12:56:30 +01:00
s5-inserts.html Moved tests/ -> test/. 2017-02-04 12:56:30 +01:00
s5.native Moved tests/ -> test/. 2017-02-04 12:56:30 +01:00
tables-rstsubset.native RST reader/writer: properly handle table captions. 2017-02-11 22:37:07 +01:00
tables.asciidoc Moved tests/ -> test/. 2017-02-04 12:56:30 +01:00
tables.context Moved tests/ -> test/. 2017-02-04 12:56:30 +01:00
tables.docbook4 Moved tests/ -> test/. 2017-02-04 12:56:30 +01:00
tables.docbook5 Moved tests/ -> test/. 2017-02-04 12:56:30 +01:00
tables.dokuwiki Moved tests/ -> test/. 2017-02-04 12:56:30 +01:00
tables.fb2 Moved tests/ -> test/. 2017-02-04 12:56:30 +01:00
tables.haddock Moved tests/ -> test/. 2017-02-04 12:56:30 +01:00
tables.html4 Moved tests/ -> test/. 2017-02-04 12:56:30 +01:00
tables.html5 Moved tests/ -> test/. 2017-02-04 12:56:30 +01:00
tables.icml Moved tests/ -> test/. 2017-02-04 12:56:30 +01:00
tables.latex Updated table tests. 2017-02-23 22:34:10 +01:00
tables.man Moved tests/ -> test/. 2017-02-04 12:56:30 +01:00
tables.markdown Moved tests/ -> test/. 2017-02-04 12:56:30 +01:00
tables.mediawiki Moved tests/ -> test/. 2017-02-04 12:56:30 +01:00
tables.native Moved tests/ -> test/. 2017-02-04 12:56:30 +01:00
tables.opendocument Moved tests/ -> test/. 2017-02-04 12:56:30 +01:00
tables.org Moved tests/ -> test/. 2017-02-04 12:56:30 +01:00
tables.plain Moved tests/ -> test/. 2017-02-04 12:56:30 +01:00
tables.rst RST reader/writer: properly handle table captions. 2017-02-11 22:37:07 +01:00
tables.rtf Moved tests/ -> test/. 2017-02-04 12:56:30 +01:00
tables.tei Moved tests/ -> test/. 2017-02-04 12:56:30 +01:00
tables.texinfo Moved tests/ -> test/. 2017-02-04 12:56:30 +01:00
tables.textile Moved tests/ -> test/. 2017-02-04 12:56:30 +01:00
tables.txt Moved tests/ -> test/. 2017-02-04 12:56:30 +01:00
tables.zimwiki ZimWiki writer: removed internal formatting from note and table cells, because ZimWiki does not support it (#3446) 2017-02-15 11:28:02 +01:00
test-pandoc.hs Add Org writer unit tests 2017-02-12 17:09:07 +03:00
testsuite.native Moved tests/ -> test/. 2017-02-04 12:56:30 +01:00
testsuite.txt Moved tests/ -> test/. 2017-02-04 12:56:30 +01:00
textile-reader.native Moved tests/ -> test/. 2017-02-04 12:56:30 +01:00
textile-reader.textile Moved tests/ -> test/. 2017-02-04 12:56:30 +01:00
twiki-reader.native Moved tests/ -> test/. 2017-02-04 12:56:30 +01:00
twiki-reader.twiki Moved tests/ -> test/. 2017-02-04 12:56:30 +01:00
txt2tags.native Moved tests/ -> test/. 2017-02-04 12:56:30 +01:00
txt2tags.t2t Moved tests/ -> test/. 2017-02-04 12:56:30 +01:00
writer.asciidoc Moved tests/ -> test/. 2017-02-04 12:56:30 +01:00
writer.context Moved tests/ -> test/. 2017-02-04 12:56:30 +01:00
writer.docbook4 Moved tests/ -> test/. 2017-02-04 12:56:30 +01:00
writer.docbook5 Moved tests/ -> test/. 2017-02-04 12:56:30 +01:00
writer.dokuwiki Moved tests/ -> test/. 2017-02-04 12:56:30 +01:00
writer.fb2 Added warnings for non-rendered blocks to some writers. 2017-02-17 23:11:31 +01:00
writer.haddock Moved tests/ -> test/. 2017-02-04 12:56:30 +01:00
writer.html4 Moved tests/ -> test/. 2017-02-04 12:56:30 +01:00
writer.html5 Make default.html5 polyglot markup conformant. (#3473) 2017-03-04 10:08:38 +01:00
writer.icml Moved tests/ -> test/. 2017-02-04 12:56:30 +01:00
writer.latex LaTeX writer: always add hypertarget when there's a non-empty identifier. 2017-03-01 21:38:28 +01:00
writer.man Moved tests/ -> test/. 2017-02-04 12:56:30 +01:00
writer.markdown Moved tests/ -> test/. 2017-02-04 12:56:30 +01:00
writer.mediawiki MediaWiki writer: Remove newline before </ref>. 2017-02-21 23:03:10 +01:00
writer.native Moved tests/ -> test/. 2017-02-04 12:56:30 +01:00
writer.opendocument Moved tests/ -> test/. 2017-02-04 12:56:30 +01:00
writer.opml Moved tests/ -> test/. 2017-02-04 12:56:30 +01:00
writer.org Org writer: reduce to two spaces after bullets 2017-02-04 21:15:05 +01:00
writer.plain Moved tests/ -> test/. 2017-02-04 12:56:30 +01:00
writer.rst Moved tests/ -> test/. 2017-02-04 12:56:30 +01:00
writer.rtf Moved tests/ -> test/. 2017-02-04 12:56:30 +01:00
writer.tei Moved tests/ -> test/. 2017-02-04 12:56:30 +01:00
writer.texinfo Moved tests/ -> test/. 2017-02-04 12:56:30 +01:00
writer.textile Moved tests/ -> test/. 2017-02-04 12:56:30 +01:00
writer.zimwiki ZimWiki writer: removed internal formatting from note and table cells, because ZimWiki does not support it (#3446) 2017-02-15 11:28:02 +01:00
writers-lang-and-dir.context Moved tests/ -> test/. 2017-02-04 12:56:30 +01:00
writers-lang-and-dir.latex LaTeX writer: always add hypertarget when there's a non-empty identifier. 2017-03-01 21:38:28 +01:00
writers-lang-and-dir.native Moved tests/ -> test/. 2017-02-04 12:56:30 +01:00