Browse Source

fixed in HTMLParser: </nofilter> tag was printed

htmlparserlistener
Tomasz Sowa 1 year ago
parent
commit
c54c398828
  1. 21
      src/html/htmlparser.cpp

21
src/html/htmlparser.cpp

@ -1126,7 +1126,7 @@ return true;
void HTMLParser::PutClosingTag(const Item & item)
{
if( skip_tags || !IsTagSafe(item.name) )
if( skip_tags || !IsTagSafe(item.name) || IsNameEqual(no_filter_tag, LastItem().name) )
return;
if( item.is_commentary )
@ -1945,17 +1945,22 @@ void HTMLParser::CheckClosingTags()
{
CheckWhiteCharsExceptions(pstack[z]);
if( !skip_tags && pstack[z].new_line )
if( !skip_tags && IsTagSafe(LastItem().name) && !IsNameEqual(no_filter_tag, LastItem().name) )
{
if( current_white_char_mode() == WHITE_MODE_TREE )
if( pstack[z].new_line )
{
Put(10);
PutTabs(pstack[z].tree_index);
if( current_white_char_mode() == WHITE_MODE_TREE )
{
Put(10);
PutTabs(pstack[z].tree_index);
}
}
}
PutClosingTag(pstack[z]);
pstack[z].Clear();
// IMPROVEME
// in PutClosingTag we test IsTagSafe() and no_filter_tag too
PutClosingTag(pstack[z]);
pstack[z].Clear();
}
}
// invalidate items on the stack

Loading…
Cancel
Save