BugFix/Enhance: Fix underlines in HTML copy, refactor/fix HTML generatio...

...n.

The CSS declaration for underlines (and overlines and strike-throughs) is
introduce by the words "text-decoration" NOT "font-decoration", this commit
fixes that error. https://bugs.launchpad.net/mudlet/+bug/1130450 raised
this issue and is solved by it.

Also the HTML that the "copyToHTML" context menu item for TConsoles
produced was not being closed at the end and was not W3C standards
compliant:
* missing a mandatory \<title\>\</title\> entry, now the source is identified
  and thus will appear in the title bar of most modern GUI web browsers.
  "Mudlet MUD Client" and the version is also included in the HTML
  metadata to identify the "generator" of the HTML.
* the charset setting \<meta\> tag was not the earliest it could be in the
  document {it forces a parser restart when it is encountered} - it is now
  at the earliest point it can be.
* there were few line feeds so later manual editing would have been very
  hard (everything on one line!) - now the layout is naturally broken into
  lines.
* all content was contained in \<span\>\</span\> tags but these must be inside
  a block element, now a \<div\>\</div\> has been used as a wrapper.
* no attempt was made to use the font or size of that was being used by the TConsole
  whose text was being reproduced by the method, since this can currently
  be changed for main profile consoles (and might in future be possible for
  user MiniConsoles) this seemed an oversight - this commit attempts to
  address this.

As far as possible QStringLiteral()s have been used to produce the HTML
because using the '+' operator or the .append() method on QStrings is
less efficient when used multiple times to build up a QString - the costs
of combining the data moves more to the compile time when QStringLiteral()
is used - it also silently marks a string that is NOT a candidate for
translation c.f. QObject::tr() method that does the opposite.  A plain
QString( "ASCII string" ) WILL be noisily noticed once QT_NO_CAST_FROM_ASCII
is defined!

Because all the \<span\>s are at the same document level the formatting
setting for one does not seem to overwrite the default for the next so that
CSS for "normal" values of fontWeight, fontStyle and textDecoration do not
need to be explicitly included for each span that has those settings, this
reduces somewhat the amount of CSS data in the file.

################################ TODO #####################################
In the future the CSS could be reduced by a great deal more if two passes
were made through the data to include, so that all the difference styles
for all the spans could be identified on the first pass, then included only
once in the header with each span containing a reference to the style it
needed rather than a verbose instance of it in the second pass when the
HTML is actually produced.
###########################################################################

Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
> At the moment the new copy to html text is far smaller than 2.1.

Do you mean the size in bytes or the reproduced size of the text by the browser?  According to the web standards(?) the default font size should be 16 which might be a bit on the large size to reproduce a full size main console dump...

Unfortunately font size can influence the actual font or at least the visual appearance even of the nominally the same family that is used by the font rendering system so it makes sense to try and get it the same as what was used - I checked and noticed that for pretty much each 7% change in the base size the visual rendition changed for me (a step change in the displayed height and/or width) which can affect the geometry of what is displayed.  The maths I used seems to approximate the visual size in both browsers I checked it with (Dillo 3.0.2, without any zoom control, and IceWeasel 24.8.1) though I could not find a way to be certain the latter was at default magnification.