Issue #92 - OLD problem of ins and del

These are marked as CM_INLINE, but also CM_BLOCK,
so should not be stacked for insertion
This commit is contained in:
Geoff McLane 2015-01-28 11:48:29 +01:00
parent d905b1037f
commit ec4d4cd1f1
3 changed files with 12 additions and 0 deletions

View file

@ -41,6 +41,12 @@ static Bool IsNodePushable( Node *node )
if (node->tag->model & CM_OBJECT) if (node->tag->model & CM_OBJECT)
return no; return no;
/*\ Issue #92: OLD problem of ins and del which are marked as both
* inline and block, thus should NOT ever be 'inserted'
\*/
if (nodeIsINS(node) || nodeIsDEL(node))
return no;
return yes; return yes;
} }

View file

@ -2138,6 +2138,9 @@ Node* TY_(GetToken)( TidyDocImpl* doc, GetTokenMode mode )
/* at start of block elements, unclosed inline /* at start of block elements, unclosed inline
elements are inserted into the token stream */ elements are inserted into the token stream */
if (lexer->insert || lexer->inode) { if (lexer->insert || lexer->inode) {
/*\ Issue #92: could fix by the following, but instead chose not to stack these 2
* if ( !(lexer->insert && (nodeIsINS(lexer->insert) || nodeIsDEL(lexer->insert))) ) {
\*/
lexer->token = TY_(InsertedToken)( doc ); lexer->token = TY_(InsertedToken)( doc );
node = lexer->token; node = lexer->token;
GTDBG(doc,"lex-inserted2", node); GTDBG(doc,"lex-inserted2", node);

View file

@ -228,6 +228,9 @@ uint TY_(nodeHeaderLevel)( Node* node ); /* 1, 2, ..., 6 */
#define nodeIsCANVAS( node ) TagIsId( node, TidyTag_CANVAS ) #define nodeIsCANVAS( node ) TagIsId( node, TidyTag_CANVAS )
#define nodeIsPROGRESS( node ) TagIsId( node, TidyTag_PROGRESS ) #define nodeIsPROGRESS( node ) TagIsId( node, TidyTag_PROGRESS )
#define nodeIsINS( node ) TagIsId( node, TidyTag_INS )
#define nodeIsDEL( node ) TagIsId( node, TidyTag_DEL )
/* HTML5 */ /* HTML5 */
#define nodeIsDATALIST( node ) TagIsId( node, TidyTag_DATALIST ) #define nodeIsDATALIST( node ) TagIsId( node, TidyTag_DATALIST )
/* NOT in HTML 5 */ /* NOT in HTML 5 */