From 5af562caec6cbe8d64b263797bdc9cf5cd29a98c Mon Sep 17 00:00:00 2001 From: Abs62 Date: Sat, 13 Dec 2014 18:09:42 +0300 Subject: [PATCH] Stardict: Handle
tags in dictionary decription --- stardict.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/stardict.cc b/stardict.cc index ffca3c35..0a51f726 100644 --- a/stardict.cc +++ b/stardict.cc @@ -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( "
", "\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", "
" ); - desc.replace( "\\n", "
" ); + desc.replace( "\\n", "\n" ); + desc.replace( "
", "\n", Qt::CaseInsensitive ); dictionaryDescription += Html::unescape( desc ); }