fdo#74595 Make HTML detection to follow specs

See http://www.w3.org/TR/html-markup/documents.html#conformant-html

Change-Id: Id2835f20baad20bcb874df5e6f35a189c320367b
Reviewed-on: https://gerrit.libreoffice.org/8079
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>