mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-30 17:24:08 +00:00
Stardict: Handle <br> tags in dictionary decription
This commit is contained in:
parent
39b0625c0c
commit
5af562caec
|
@ -561,7 +561,10 @@ QString const& StardictDictionary::getDescription()
|
|||
Ifo ifo( ifoFile );
|
||||
|
||||
if( !ifo.copyright.empty() )
|
||||
dictionaryDescription += "Copyright: " + QString::fromUtf8( ifo.copyright.c_str() ) + "\n\n";
|
||||
dictionaryDescription += "Copyright: "
|
||||
+ QString::fromUtf8( ifo.copyright.c_str() )
|
||||
.replace( "<br>", "\n", Qt::CaseInsensitive )
|
||||
+ "\n\n";
|
||||
|
||||
if( !ifo.author.empty() )
|
||||
dictionaryDescription += "Author: " + QString::fromUtf8( ifo.author.c_str() ) + "\n\n";
|
||||
|
@ -573,7 +576,8 @@ QString const& StardictDictionary::getDescription()
|
|||
{
|
||||
QString desc = QString::fromUtf8( ifo.description.c_str() );
|
||||
desc.replace( "\t", "<br/>" );
|
||||
desc.replace( "\\n", "<br/>" );
|
||||
desc.replace( "\\n", "\n" );
|
||||
desc.replace( "<br>", "\n", Qt::CaseInsensitive );
|
||||
dictionaryDescription += Html::unescape( desc );
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue