Stardict: Handle <br> tags in dictionary decription

This commit is contained in:
Abs62 2014-12-13 18:09:42 +03:00
parent 39b0625c0c
commit 5af562caec

View file

@ -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 );
}