Indicated by #191, why show doctype warning if omitted in output
This commit is contained in:
parent
5cbd3ee95b
commit
e78c0105d3
12
src/parser.c
12
src/parser.c
|
@ -4671,10 +4671,16 @@ void TY_(ParseDocument)(TidyDocImpl* doc)
|
||||||
else
|
else
|
||||||
html = node;
|
html = node;
|
||||||
|
|
||||||
/* #72, avoid MISSING_DOCTYPE if show-body-only. */
|
/*\
|
||||||
|
* #72, avoid MISSING_DOCTYPE if show-body-only.
|
||||||
|
* #191, also if --doctype omit, that is TidyDoctypeOmit
|
||||||
|
\*/
|
||||||
if (!TY_(FindDocType)(doc) && !showingBodyOnly(doc))
|
if (!TY_(FindDocType)(doc) && !showingBodyOnly(doc))
|
||||||
TY_(ReportError)(doc, NULL, NULL, MISSING_DOCTYPE);
|
{
|
||||||
|
ulong dtmode = cfg( doc, TidyDoctypeMode );
|
||||||
|
if (dtmode != TidyDoctypeOmit)
|
||||||
|
TY_(ReportError)(doc, NULL, NULL, MISSING_DOCTYPE);
|
||||||
|
}
|
||||||
TY_(InsertNodeAtEnd)( &doc->root, html);
|
TY_(InsertNodeAtEnd)( &doc->root, html);
|
||||||
TY_(ParseHTML)( doc, html, IgnoreWhitespace );
|
TY_(ParseHTML)( doc, html, IgnoreWhitespace );
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue