htmlq icon indicating copy to clipboard operation
htmlq copied to clipboard

htmlq removes the DOCTYPE

Open KenSharp opened this issue 2 years ago • 2 comments

HTML5 asks specifically for the DOCTYPE:

<!DOCTYPE html>

but running htmlq removes this. There doesn't seem to be an option to disable this behaviour, and it is certainly not desirable.

After using htmlq, the pages fail to validate with the W3C validator.

The suggested workaround doesn't work either:

<!DOCTYPE html SYSTEM "about:legacy-compat">

Indeed, testing shows that any line starting with <! anywhere in the code is stripped by htmlq.

KenSharp avatar Nov 10 '22 11:11 KenSharp

I confirm this issue. My usage htmlq -r '#WebPartWPQ5 *' -f "$f" | sponge "$f"

IGLOU-EU avatar Jul 25 '23 22:07 IGLOU-EU

@IGLOU-EU thanks for mentioning sponge--it lead me to the moreutils package, of which I was unaware, and shall find useful. :)

XLTechie avatar Jul 26 '23 02:07 XLTechie