From 817ef6446cc53a17a8cb01add26a295e6848fb70 Mon Sep 17 00:00:00 2001 From: Geoff McLane Date: Mon, 14 May 2018 20:51:59 +0200 Subject: [PATCH] Is #729 - Show 'warnings' in all cases --- src/tidylib.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/tidylib.c b/src/tidylib.c index 31754ab..fd9da56 100644 --- a/src/tidylib.c +++ b/src/tidylib.c @@ -1863,7 +1863,8 @@ void TY_(CheckHTMLTagsAttribsVersions)( TidyDocImpl* doc, Node* node ) next_attr = attval->next; attrIsProprietary = TY_(AttributeIsProprietary)(node, attval); - attrIsMismatched = check_versions ? TY_(AttributeIsMismatched)(node, attval, doc) : no; + /* Is. #729 - always check version match if HTML5 */ + attrIsMismatched = (check_versions | htmlIs5) ? TY_(AttributeIsMismatched)(node, attval, doc) : no; /* Let the PROPRIETARY_ATTRIBUTE warning have precedence. */ if ( attrIsProprietary ) { @@ -1872,7 +1873,15 @@ void TY_(CheckHTMLTagsAttribsVersions)( TidyDocImpl* doc, Node* node ) } else if ( attrIsMismatched ) { - TY_(ReportAttrError)(doc, node, attval, attrReportType); + if (htmlIs5) + { + /* Is. #729 - In html5 TidyStrictTagsAttr controls error or warn */ + TY_(ReportAttrError)(doc, node, attval, + check_versions ? MISMATCHED_ATTRIBUTE_ERROR : MISMATCHED_ATTRIBUTE_WARN); + } + else + TY_(ReportAttrError)(doc, node, attval, attrReportType); + } /* @todo: do we need a new option to drop mismatches? Or should we