Merge pull request #502 from htacg/issue-498
Issue #498 - parser.c - if a <table> in a <table> just close. This fixes #498
This commit is contained in:
commit
323ddacf5d
15
src/parser.c
15
src/parser.c
|
@ -3019,9 +3019,22 @@ void TY_(ParseTableTag)(TidyDocImpl* doc, Node *table, GetTokenMode ARG_UNUSED(m
|
||||||
|
|
||||||
while ((node = TY_(GetToken)(doc, IgnoreWhitespace)) != NULL)
|
while ((node = TY_(GetToken)(doc, IgnoreWhitespace)) != NULL)
|
||||||
{
|
{
|
||||||
if (node->tag == table->tag && node->type == EndTag)
|
if (node->tag == table->tag )
|
||||||
|
{
|
||||||
|
if (node->type == EndTag)
|
||||||
{
|
{
|
||||||
TY_(FreeNode)(doc, node);
|
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;
|
lexer->istackbase = istackbase;
|
||||||
table->closed = yes;
|
table->closed = yes;
|
||||||
#if !defined(NDEBUG) && defined(_MSC_VER)
|
#if !defined(NDEBUG) && defined(_MSC_VER)
|
||||||
|
|
Loading…
Reference in a new issue