mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-30 17:24:08 +00:00
MDict: Fix links handling
This commit is contained in:
parent
d8eba31d2d
commit
81d56b73f9
22
mdx.cc
22
mdx.cc
|
@ -987,19 +987,15 @@ QString & MdxDictionary::filterResource( QString const & articleId, QString & ar
|
||||||
if( pos < 0 )
|
if( pos < 0 )
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if( wordCrossLink.cap( 3 ).isEmpty() )
|
QString newLink = wordCrossLink.cap( 1 )
|
||||||
pos += wordCrossLink.cap( 0 ).size();
|
+ "gdlookup://localhost/"
|
||||||
else
|
+ wordCrossLink.cap( 2 );
|
||||||
{
|
|
||||||
QString newLink = wordCrossLink.cap( 1 )
|
if( !wordCrossLink.cap( 3 ).isEmpty() )
|
||||||
+ "gdlookup://localhost/"
|
newLink += QString( "?gdanchor=" ) + uniquePrefix + wordCrossLink.cap( 3 ).mid( 1 );
|
||||||
+ wordCrossLink.cap( 2 )
|
|
||||||
+ ( wordCrossLink.cap( 3 ).isEmpty() ? "" : QString( "?gdanchor=" )
|
article.replace( pos, wordCrossLink.cap( 0 ).size(), newLink );
|
||||||
+ uniquePrefix + wordCrossLink.cap( 3 ).mid( 1 )
|
pos += newLink.size();
|
||||||
);
|
|
||||||
article.replace( pos, wordCrossLink.cap( 0 ).size(), newLink );
|
|
||||||
pos += newLink.size();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return article;
|
return article;
|
||||||
|
|
Loading…
Reference in a new issue