From 66ade9def43f1a86e5c6a933edc2f80ce1b3a380 Mon Sep 17 00:00:00 2001 From: Jim Derry Date: Tue, 14 Mar 2017 16:27:11 -0400 Subject: [PATCH] Still noisy, but adds HTML5 dependent output message upon detection. --- src/tags.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/tags.c b/src/tags.c index 2efbf5b..7965002 100644 --- a/src/tags.c +++ b/src/tags.c @@ -563,8 +563,8 @@ Bool TY_(FindTag)( TidyDocImpl* doc, Node *node ) /* Add anonymous custom tag */ if ( TY_(nodeIsAutonomousCustomTag)( doc, node) ) { - TidyUseCustomTagsState configtype = cfg( doc, TidyUseCustomTags ); UserTagType type; + TidyUseCustomTagsState configtype = cfg( doc, TidyUseCustomTags ); if ( configtype == TidyCustomEmpty ) type = tagtype_empty; @@ -577,7 +577,17 @@ Bool TY_(FindTag)( TidyDocImpl* doc, Node *node ) TY_(DeclareUserTag)( doc, TidyCustomTags, type, node->element ); node->tag = tagsLookup(doc, &doc->tags, node->element); - TY_(ReportNotice)(doc, node, node, CUSTOM_TAG_DETECTED); + + if ( (doc->lexer->doctype & VERS_HTML5) ) + { + TY_(ReportNotice)(doc, node, node, CUSTOM_TAG_DETECTED); + } + else + { + /* TODO: not sure whether to include this here, or let it + happen where it already happens; still need to suppress elsewhere */ + TY_(ReportError)(doc, NULL, node, PROPRIETARY_ELEMENT); + } return yes; }