From 6c1a2acea203cb4fdbc331fbb1f6649598db1ab5 Mon Sep 17 00:00:00 2001 From: Geoff McLane Date: Sun, 27 Sep 2015 17:36:57 +0200 Subject: [PATCH] #273 - avoid xhtml doctype flip/flop --- src/lexer.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/lexer.c b/src/lexer.c index 638f72f..8cc2b0d 100644 --- a/src/lexer.c +++ b/src/lexer.c @@ -1771,6 +1771,16 @@ Bool TY_(SetXHTMLDocType)( TidyDocImpl* doc ) TY_(RepairAttrValue)(doc, doctype, sys, GetSIFromVers(X10T)); lexer->versionEmitted = X10T; } + else if (lexer->versions & VERS_HTML5) + { + /*\ + * Issue #273 - If still a html5/xhtml5 bit + * existing, that is the 'ConstrainVersion' has + * not eliminated all HTML5, then nothing to do here. + * Certainly do **not** delete the DocType node! + * see: http://www.w3.org/QA/Tips/Doctype + \*/ + } else { if (doctype)