diff --git a/include/tidyenum.h b/include/tidyenum.h index bc76cf3..fecce09 100644 --- a/include/tidyenum.h +++ b/include/tidyenum.h @@ -169,6 +169,7 @@ extern "C" { FN(BACKSLASH_IN_URI) \ FN(BAD_ATTRIBUTE_VALUE_REPLACED) \ FN(BAD_ATTRIBUTE_VALUE) \ + FN(ATTRIBUTE_VALUE_REPLACED) \ FN(ESCAPED_ILLEGAL_URI) \ FN(FIXED_BACKSLASH) \ FN(ID_NAME_MISMATCH) \ diff --git a/src/clean.c b/src/clean.c index 76b6acf..819767d 100644 --- a/src/clean.c +++ b/src/clean.c @@ -2371,8 +2371,8 @@ Bool TY_(TidyMetaCharset)(TidyDocImpl* doc) TY_(tmbstrcpy)(newValue, enc); /* Note: previously http-equiv had been modified, without warning in void TY_(VerifyHTTPEquiv)(TidyDocImpl* doc, Node *head) - TY_(ReportAttrError)( doc, currentNode, charsetAttr, BAD_ATTRIBUTE_VALUE_REPLACED ); */ + TY_(ReportAttrError)(doc, currentNode, charsetAttr, ATTRIBUTE_VALUE_REPLACED); TidyDocFree(doc, charsetAttr->value); /* free current value */ charsetAttr->value = newValue; } @@ -2450,9 +2450,10 @@ Bool TY_(TidyMetaCharset)(TidyDocImpl* doc) { /* correct the content */ newValue = (tmbstr)TidyDocAlloc(doc, 19 + TY_(tmbstrlen)(enc) + 1); - TidyDocFree(doc, contentAttr->value); TY_(tmbstrcpy)(newValue, "text/html; charset="); TY_(tmbstrcpy)(newValue + 19, enc); + TY_(ReportAttrError)(doc, currentNode, contentAttr, ATTRIBUTE_VALUE_REPLACED); + TidyDocFree(doc, contentAttr->value); contentAttr->value = newValue; charsetFound = yes; } diff --git a/src/language_en.h b/src/language_en.h index b971db1..a84b6ed 100644 --- a/src/language_en.h +++ b/src/language_en.h @@ -1798,6 +1798,7 @@ static languageDefinition language_en = { whichPluralForm_en, { { BACKSLASH_IN_URI, 0, "%s URI reference contains backslash. Typo?" }, /* ReportAttrError */ { BAD_ATTRIBUTE_VALUE_REPLACED, 0, "%s attribute \"%s\" had invalid value \"%s\" and has been replaced" }, /* ReportAttrError */ { BAD_ATTRIBUTE_VALUE, 0, "%s attribute \"%s\" has invalid value \"%s\"" }, /* ReportAttrError */ + { ATTRIBUTE_VALUE_REPLACED, 0, "%s attribute \"%s\", incorrect value \"%s\" replaced" }, /* ReportAttrError/TidyInfo */ { ESCAPED_ILLEGAL_URI, 0, "%s escaping malformed URI reference" }, /* ReportAttrError */ { FIXED_BACKSLASH, 0, "%s converting backslash in URI to slash" }, /* ReportAttrError */ { ID_NAME_MISMATCH, 0, "%s id and name attribute value mismatch" }, /* ReportAttrError */ diff --git a/src/message.c b/src/message.c index 5330e3e..3ab40e7 100755 --- a/src/message.c +++ b/src/message.c @@ -526,6 +526,10 @@ void TY_(ReportAttrError)(TidyDocImpl* doc, Node *node, AttVal *av, uint code) message = TY_(tidyMessageCreateWithNode)(doc, node, code, TidyWarning, tagdesc, name, value ); break; + case ATTRIBUTE_VALUE_REPLACED: + message = TY_(tidyMessageCreateWithNode)(doc, node, code, TidyInfo, tagdesc, name, value); + break; + case UNEXPECTED_QUOTEMARK: case MISSING_QUOTEMARK: case ID_NAME_MISMATCH: