mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-27 19:24:08 +00:00
fix: qt warning when parsing unknown color attribute
related to goldendict/goldendict#1578
This commit is contained in:
parent
d969b63c1e
commit
2263dfc8da
|
@ -390,7 +390,7 @@ div.xdxf
|
||||||
display:inline;
|
display:inline;
|
||||||
}
|
}
|
||||||
|
|
||||||
.dsl_article font[color=c_default_color]
|
.dsl_article .c_default_color
|
||||||
{
|
{
|
||||||
color: green;
|
color: green;
|
||||||
}
|
}
|
||||||
|
|
|
@ -396,7 +396,7 @@ div.xdxf
|
||||||
display:inline;
|
display:inline;
|
||||||
}
|
}
|
||||||
|
|
||||||
.dsl_article font[color=c_default_color]
|
.dsl_article .c_default_color
|
||||||
{
|
{
|
||||||
color: green;
|
color: green;
|
||||||
}
|
}
|
||||||
|
|
14
dsl.cc
14
dsl.cc
|
@ -809,9 +809,17 @@ string DslDictionary::nodeToHtml( ArticleDom::Node const & node )
|
||||||
}
|
}
|
||||||
else if( node.tagName == U"c" )
|
else if( node.tagName == U"c" )
|
||||||
{
|
{
|
||||||
result += "<font color=\"" + ( node.tagAttrs.size() ?
|
if( node.tagAttrs.empty() )
|
||||||
Html::escape( Utf8::encode( node.tagAttrs ) ) : string( "c_default_color" ) )
|
{
|
||||||
+ "\">" + processNodeChildren( node ) + "</font>";
|
result += "<span class=\"c_default_color\">"
|
||||||
|
+ processNodeChildren( node ) + "</span>";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
result += "<font color=\""
|
||||||
|
+ Html::escape( Utf8::encode( node.tagAttrs ) ) + "\">"
|
||||||
|
+ processNodeChildren( node ) + "</font>";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if( node.tagName == U"*" )
|
else if( node.tagName == U"*" )
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue