diff --git a/mdx.cc b/mdx.cc index 2779f5b1..945a27c9 100644 --- a/mdx.cc +++ b/mdx.cc @@ -271,7 +271,7 @@ private: void doDeferredInit(); /// Loads an article with the given offset, filling the given strings. - void loadArticle( uint32_t offset, string & articleText ); + void loadArticle( uint32_t offset, string & articleText, bool noFilter = false ); /// Process resource links (images, audios, etc) QString & filterResource( QString const & articleId, QString & article ); @@ -506,7 +506,7 @@ void MdxDictionary::getArticleText( uint32_t articleAddress, QString & headword, headword.clear(); string articleText; - loadArticle( articleAddress, articleText ); + loadArticle( articleAddress, articleText, true ); text = Html::unescape( QString::fromUtf8( articleText.data(), articleText.size() ) ); } catch( std::exception &ex ) @@ -916,7 +916,7 @@ void MdxDictionary::loadIcon() throw() dictionaryIconLoaded = true; } -void MdxDictionary::loadArticle( uint32_t offset, string & articleText ) +void MdxDictionary::loadArticle( uint32_t offset, string & articleText, bool noFilter ) { vector< char > chunk; Mutex::Lock _( idxMutex ); @@ -944,7 +944,8 @@ void MdxDictionary::loadArticle( uint32_t offset, string & articleText ) recordInfo.recordSize ); article = MdictParser::substituteStylesheet( article, styleSheets ); - article = filterResource( articleId, article ); + if( !noFilter ) + article = filterResource( articleId, article ); articleText = string( article.toUtf8().constData() ); }