mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-24 00:14:06 +00:00
fix: treat unknown dsl tags as text
This commit is contained in:
parent
7037694ebc
commit
119a5ccb6c
|
@ -656,18 +656,12 @@ void ArticleDom::closeTag( wstring const & name,
|
|||
if ( n != stack.rend() )
|
||||
{
|
||||
// If there is a corresponding tag, close all tags above it,
|
||||
// then close the tag itself, then reopen all the tags which got
|
||||
// closed.
|
||||
|
||||
list< Node > nodesToReopen;
|
||||
// then close the tag itself
|
||||
|
||||
while ( !stack.empty() ) {
|
||||
bool found = stack.back()->tagName == name ||
|
||||
checkM( stack.back()->tagName, name );
|
||||
|
||||
if ( !found )
|
||||
nodesToReopen.emplace_back( Node::Tag(), stack.back()->tagName, stack.back()->tagAttrs );
|
||||
|
||||
if( stack.back()->empty() && stack.back()->tagName != U"br" )
|
||||
{
|
||||
// Empty nodes except [br] tag are deleted since they're no use
|
||||
|
@ -684,21 +678,6 @@ void ArticleDom::closeTag( wstring const & name,
|
|||
if ( found )
|
||||
break;
|
||||
}
|
||||
|
||||
while ( !nodesToReopen.empty() ) {
|
||||
if ( stack.empty() )
|
||||
{
|
||||
root.push_back( nodesToReopen.back() );
|
||||
stack.push_back( &root.back() );
|
||||
}
|
||||
else
|
||||
{
|
||||
stack.back()->push_back( nodesToReopen.back() );
|
||||
stack.push_back( &stack.back()->back() );
|
||||
}
|
||||
|
||||
nodesToReopen.pop_back();
|
||||
}
|
||||
}
|
||||
else
|
||||
if ( warn )
|
||||
|
|
|
@ -531,6 +531,10 @@ div.xdxf
|
|||
color: gray;
|
||||
}
|
||||
|
||||
.dsl_unknown{
|
||||
border-bottom: 3px double red;
|
||||
}
|
||||
|
||||
/* Style for expand optional parts button */
|
||||
.hidden_expand_opt
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue