Issue #572 - discard an all space text node.
An earlier patch now passes back an all space text node. Previously this would have been skipped. So add code in ParseList to detect, and discard such a node. Change committed: modified: src/parser.c
This commit is contained in:
parent
f26a068809
commit
09f1806834
15
src/parser.c
15
src/parser.c
|
@ -2475,6 +2475,21 @@ void TY_(ParseList)(TidyDocImpl* doc, Node *list, GetTokenMode ARG_UNUSED(mode))
|
||||||
TY_(FreeNode)( doc, node);
|
TY_(FreeNode)( doc, node);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if (lexer && (node->type == TextNode))
|
||||||
|
{
|
||||||
|
uint ch, ix = node->start;
|
||||||
|
/* Issue #572 - Skip whitespace. */
|
||||||
|
while (ix < node->end && (ch = (lexer->lexbuf[ix] & 0xff))
|
||||||
|
&& (ch == ' ' || ch == '\t' || ch == '\r' || ch == '\n'))
|
||||||
|
++ix;
|
||||||
|
if (ix >= node->end)
|
||||||
|
{
|
||||||
|
/* Issue #572 - Discard if ALL whitespace. */
|
||||||
|
TY_(FreeNode)(doc, node);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
if this is the end tag for an ancestor element
|
if this is the end tag for an ancestor element
|
||||||
|
|
Loading…
Reference in a new issue