htacg / tidy-html5

The granddaddy of HTML tools, with support for modern standards
http://www.html-tidy.org
2.72k stars 420 forks source link

--doctype html5 leaves ?xml and xmlns #805

Open jidanni opened 5 years ago

jidanni commented 5 years ago

Here we observe tidy --doctype html5 is helpless at getting rid of the ?xml and xmlns lines in

$ pod2html /dev/null | sed 's/rev=/rel=/ #fix pod2html bug' | tidy -q --doctype html5
<?xml version="1.0"?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="generator" content=
"HTML Tidy for HTML5 for Linux version 5.6.0" />
<title></title>
<meta http-equiv="content-type" content=
"text/html; charset=utf-8" />
<link rel="made" href="mailto:root@localhost" />
</head>
<body>
</body>
</html>

Well at least on the man page at --doctype html5 mention what to do. See also #658, #767.

geoffmcl commented 5 years ago

@jidanni can only agree tidy's handling of xml/xhtml leaves a lot to be desired, as indicated here, in #658, #767, and maybe others...

There have been no code/docs changes, fixes, enhancements, etc, etc..., in this xhtml area, since forever... needs some TLC...

Also agree the doctype ref. does not make it very clear that is does virtually nothing to the document! Except change the output DOCTYPE... It does say This option does not offer a validation of document conformance....

Look forward to specific code/doc change suggestions... comments, patches, PRs, ... all very welcome... thanks...