Issue #380 - Experimental patch in issue-380 branch

This commit is contained in:
Geoff McLane 2016-03-05 17:39:14 +01:00
parent b2c591c138
commit 8eee85cb9e

View file

@ -867,7 +867,8 @@ void TY_(ParseBlock)( TidyDocImpl* doc, Node *element, GetTokenMode mode)
#if !defined(NDEBUG) && defined(_MSC_VER) #if !defined(NDEBUG) && defined(_MSC_VER)
in_parse_block++; in_parse_block++;
parse_block_cnt++; parse_block_cnt++;
SPRTF("Entering ParseBlock %d... %d\n",in_parse_block,parse_block_cnt); SPRTF("Entering ParseBlock %d... %d %s\n",in_parse_block,parse_block_cnt,
((element && element->element) ? element->element : ""));
#endif #endif
if ( element->tag->model & CM_EMPTY ) { if ( element->tag->model & CM_EMPTY ) {
@ -943,14 +944,21 @@ void TY_(ParseBlock)( TidyDocImpl* doc, Node *element, GetTokenMode mode)
return; return;
} }
#if OBSOLETE /* Issue #380 Kill this code! But leave in src, just in case! */
if ( nodeIsBODY( node ) && DescendantOf( element, TidyTag_HEAD )) if ( nodeIsBODY( node ) && DescendantOf( element, TidyTag_HEAD ))
{ {
/* If we're in the HEAD, close it before proceeding. /* If we're in the HEAD, close it before proceeding.
This is an extremely rare occurance, but has been observed. This is an extremely rare occurance, but has been observed.
****************************************************************
Issue #380 - This can cause an INFINITE loop!
This code was added to SF CVS Tidy
revision 1.121 by lpassey, Wed Jul 28 18:08:06 2004 UTC
****************************************************************
*/ */
TY_(UngetToken)( doc ); TY_(UngetToken)( doc );
break; break;
} }
#endif /* #if OBSOLETE */
if ( nodeIsHTML(node) || nodeIsHEAD(node) || nodeIsBODY(node) ) if ( nodeIsHTML(node) || nodeIsHEAD(node) || nodeIsBODY(node) )
{ {