maranget / hevea

Hevea is a fast latex to html translator
http://hevea.inria.fr
Other
97 stars 12 forks source link

Fix and modernize contents of `head` (according to vnu checker) #49

Open cspiel opened 3 years ago

cspiel commented 3 years ago

The vnu checker as of version 20.6.30 always turns up the following problems with Hevea-generated HTML files (edited for clarity):

Line 4: error: Internal encoding declaration "us-ascii" disagrees
               with the actual encoding of the document ("utf-8").
Line 4: error: Bad value "text/html; charset=US-ASCII" for
               attribute "content" on element "meta": "charset="
               must be followed by "utf-8".
Line 6: info warning: The "type" attribute for the "style"
                      element is not needed and should be omitted.

This P/R addresses all three diagnostics.

In the course of fixing the problems it turned out that a new (internal) macro \@print@endline would be beneficial for the clarity and simplicity of expression. So the P/R has been split into three patches:

  1. Introduce and document \@print@endline.
  2. Use the new macro in every position where \@print needs to add a final newline character.
  3. Fix macro \@meta which generates the relevant part of the head-element's contents. Update intertwined lexers accordingly.

With this P/R Hevea generates vnu-clean headers.

maranget commented 3 years ago

Hi thanks again for your contribution.

Did your check the impact of this PR on changing the document input (and output) charset, as documented here in the user manual?

cspiel commented 3 years ago

@maranget: Sure, I have checked that this change does not break output encodings. :wink:

Following the link you gave me, I found that the documentation of package inputenc.hva would benefit of a comprehensive table that lists all available encodings, their character sets and their relations to LaTeX's inputenc.sty. Done in 2824a6b.