Skip to content

Commit

Permalink
Merge pull request #502 from htacg/issue-498
Browse files Browse the repository at this point in the history
Issue #498 - parser.c - if a <table> in a <table> just close. This fixes #498
  • Loading branch information
geoffmcl committed Mar 1, 2017
2 parents 6574225 + a49890e commit 323ddac
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions src/parser.c
Expand Up @@ -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)
Expand Down

0 comments on commit 323ddac

Please sign in to comment.