Issue #498 - parser.c - if a <table> in a <table> just close.

The previous action was to discard the second, while it is the second
table that browsers will render.

This conforms to the principle that the html output by tidy should render
in a browser like the original html.
This commit is contained in:
Geoff McLane 2017-02-24 16:19:58 +01:00
parent d07134140a
commit a49890ee55

View file

@ -3019,9 +3019,22 @@ void TY_(ParseTableTag)(TidyDocImpl* doc, Node *table, GetTokenMode ARG_UNUSED(m
while ((node = TY_(GetToken)(doc, IgnoreWhitespace)) != NULL)
{
if (node->tag == table->tag && node->type == EndTag)
if (node->tag == table->tag )
{
TY_(FreeNode)( doc, node);
if (node->type == EndTag)
{
TY_(FreeNode)(doc, node);
}
else
{
/* Issue #498 - If a <table> in a <table>
* just close the current table, and issue a
* warning. The previous action was to discard
* this second <table>
*/
TY_(UngetToken)(doc);
TY_(ReportError)(doc, table, node, TAG_NOT_ALLOWED_IN);
}
lexer->istackbase = istackbase;
table->closed = yes;
#if !defined(NDEBUG) && defined(_MSC_VER)