Merge branch 'issue_521' into next

This commit is contained in:
Jim Derry 2017-10-02 13:27:16 -04:00
commit 47a32891c8
5 changed files with 15 additions and 1 deletions

View file

@ -222,6 +222,7 @@ extern "C" {
FN(MISSING_DOCTYPE) \
FN(MISSING_ENDTAG_BEFORE) \
FN(MISSING_ENDTAG_FOR) \
FN(MISSING_ENDTAG_OPTIONAL) \
FN(MISSING_IMAGEMAP) \
FN(MISSING_QUOTEMARK) \
FN(MISSING_QUOTEMARK_OPEN) \

View file

@ -5,7 +5,7 @@ msgstr ""
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: HTML Tidy poconvert.rb\n"
"Project-Id-Version: \n"
"POT-Creation-Date: 2017-10-02 13:19:15\n"
"POT-Creation-Date: 2017-10-02 13:26:57\n"
"Last-Translator: jderry\n"
"Language-Team: \n"
@ -2367,6 +2367,11 @@ msgctxt "MISSING_ENDTAG_FOR"
msgid "missing </%s>"
msgstr ""
#, c-format
msgctxt "MISSING_ENDTAG_OPTIONAL"
msgid "missing optional end tag </%s>"
msgstr ""
#, c-format
msgctxt "MISSING_IMAGEMAP"
msgid "%s should use client-side image map"

View file

@ -1910,6 +1910,7 @@ static languageDefinition language_en = { whichPluralForm_en, {
{ MISSING_DOCTYPE, 0, "missing <!DOCTYPE> declaration" },
{ MISSING_ENDTAG_BEFORE, 0, "missing </%s> before %s" },
{ MISSING_ENDTAG_FOR, 0, "missing </%s>" },
{ MISSING_ENDTAG_OPTIONAL, 0, "missing optional end tag </%s>" },
{ MISSING_IMAGEMAP, 0, "%s should use client-side image map" },
{ MISSING_QUOTEMARK, 0, "%s attribute with missing trailing quote mark" },
{ MISSING_QUOTEMARK_OPEN, 0, "value for attribute \"%s\" missing quote marks" },

View file

@ -310,6 +310,7 @@ static struct _dispatchTable {
{ MISSING_DOCTYPE, TidyWarning, formatStandard },
{ MISSING_ENDTAG_BEFORE, TidyWarning, formatStandard },
{ MISSING_ENDTAG_FOR, TidyWarning, formatStandard },
{ MISSING_ENDTAG_OPTIONAL, TidyInfo, formatStandard },
{ MISSING_IMAGEMAP, TidyWarning, formatAttributeReport },
{ MISSING_QUOTEMARK, TidyWarning, formatAttributeReport },
{ MISSING_QUOTEMARK_OPEN, TidyInfo, formatAttributeReport },
@ -814,6 +815,7 @@ TidyMessageImpl *formatStandard(TidyDocImpl* doc, Node *element, Node *node, uin
return TY_(tidyMessageCreateWithNode)(doc, rpt, code, level, nodedesc );
case MISSING_ENDTAG_FOR:
case MISSING_ENDTAG_OPTIONAL:
case PREVIOUS_LOCATION:
return TY_(tidyMessageCreateWithNode)(doc, rpt, code, level, element->element );

View file

@ -1270,6 +1270,11 @@ void TY_(ParseBlock)( TidyDocImpl* doc, Node *element, GetTokenMode mode)
if ( !TY_(nodeHasCM)(element, CM_OPT) && !element->implicit )
TY_(Report)(doc, element, node, MISSING_ENDTAG_BEFORE );
/* #521, warn on missing optional end-tags if not omitting them. */
if ( cfgBool( doc, TidyOmitOptionalTags ) == no && TY_(nodeHasCM)(element, CM_OPT) )
TY_(Report)(doc, element, node, MISSING_ENDTAG_OPTIONAL );
TY_(UngetToken)( doc );