diff --git a/include/tidyenum.h b/include/tidyenum.h index dd148bd..313b1a3 100644 --- a/include/tidyenum.h +++ b/include/tidyenum.h @@ -632,6 +632,7 @@ typedef enum TidyUpperCaseTags, /**< Output tags in upper not lower case */ TidyUseCustomTags, /**< Enable Tidy to use autonomous custom tags */ TidyVertSpace, /**< degree to which markup is spread out vertically */ + TidyWarnPropAttrs, /**< Warns on proprietary attributes */ TidyWord2000, /**< Draconian cleaning for Word2000 */ TidyWrapAsp, /**< Wrap within ASP pseudo elements */ TidyWrapAttVals, /**< Wrap within attribute values */ diff --git a/src/config.c b/src/config.c index 221b475..19dc975 100644 --- a/src/config.c +++ b/src/config.c @@ -322,6 +322,7 @@ static const TidyOptionImpl option_defs[] = { TidyUpperCaseTags, MU, "uppercase-tags", BL, no, ParseBool, boolPicks }, { TidyUseCustomTags, MU, "custom-tags", IN, TidyCustomNo, ParseUseCustomTags,customTagsPicks }, /* 20170309 - Issue #119 */ { TidyVertSpace, PP, "vertical-space", IN, no, ParseAutoBool, autoBoolPicks }, /* #228 - tri option */ + { TidyWarnPropAttrs, MU, "warn-proprietary-attributes", BL, yes, ParseBool, boolPicks }, { TidyWord2000, MU, "word-2000", BL, no, ParseBool, boolPicks }, { TidyWrapAsp, PP, "wrap-asp", BL, yes, ParseBool, boolPicks }, { TidyWrapAttVals, PP, "wrap-attributes", BL, no, ParseBool, boolPicks }, diff --git a/src/language_en.h b/src/language_en.h index d6d1849..f68acb4 100644 --- a/src/language_en.h +++ b/src/language_en.h @@ -1296,6 +1296,17 @@ static languageDefinition language_en = { whichPluralForm_en, { "If set to auto Tidy will eliminate nearly all newline " "characters." }, + {/* Important notes for translators: + - Use only , , , , and +
. + - Entities, tags, attributes, etc., should be enclosed in . + - Option values should be enclosed in . + - It's very important that
be self-closing! + - The strings "Tidy" and "HTML Tidy" are the program name and must not + be translated. */ + TidyWarnPropAttrs, 0, + "This option specifies if Tidy should warn on proprietary attributes." + }, {/* Important notes for translators: - Use only , , , , and
. diff --git a/src/tidylib.c b/src/tidylib.c index 726df24..f324a4d 100755 --- a/src/tidylib.c +++ b/src/tidylib.c @@ -1823,7 +1823,10 @@ void TY_(CheckHTMLTagsAttribsVersions)( TidyDocImpl* doc, Node* node ) attrIsMismatched = check_versions ? TY_(AttributeIsMismatched)(node, attval, doc) : no; /* Let the PROPRIETARY_ATTRIBUTE warning have precedence. */ if ( attrIsProprietary ) - TY_(ReportAttrError)(doc, node, attval, PROPRIETARY_ATTRIBUTE); + { + if ( cfgBool(doc, TidyWarnPropAttrs) ) + TY_(ReportAttrError)(doc, node, attval, PROPRIETARY_ATTRIBUTE); + } else if ( attrIsMismatched ) { TY_(ReportAttrError)(doc, node, attval, attrReportType);