fix for ISSUE #7: empty canvas no longer stripped

This commit is contained in:
Dominique Hazael-Massieux 2012-02-24 13:31:23 +01:00
parent b0997b2c48
commit f6a3bbecdb
2 changed files with 6 additions and 1 deletions

View file

@ -284,6 +284,11 @@ static Bool CanPrune( TidyDocImpl* doc, Node *element )
if (nodeIsTEXTAREA(element)) if (nodeIsTEXTAREA(element))
return no; return no;
/* fix for ISSUE #7 https://github.com/w3c/tidy-html5/issues/7 */
if (nodeIsCANVAS(element))
return no;
if ( attrGetID(element) || attrGetNAME(element) ) if ( attrGetID(element) || attrGetNAME(element) )
return no; return no;

View file

@ -230,6 +230,6 @@ uint TY_(nodeHeaderLevel)( Node* node ); /* 1, 2, ..., 6 */
#define nodeIsU( node ) TagIsId( node, TidyTag_U ) #define nodeIsU( node ) TagIsId( node, TidyTag_U )
#define nodeIsMENU( node ) TagIsId( node, TidyTag_MENU ) #define nodeIsMENU( node ) TagIsId( node, TidyTag_MENU )
#define nodeIsBUTTON( node ) TagIsId( node, TidyTag_BUTTON ) #define nodeIsBUTTON( node ) TagIsId( node, TidyTag_BUTTON )
#define nodeIsCANVAS( node ) TagIsId( node, TidyTag_CANVAS )
#endif /* __TAGS_H__ */ #endif /* __TAGS_H__ */