mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-24 00:14:06 +00:00
Aard: Handle inter-article anchors
This commit is contained in:
parent
d500b3d6e7
commit
5018f384f4
4
aard.cc
4
aard.cc
|
@ -393,6 +393,10 @@ string AardDictionary::convert( const string & in )
|
|||
text.replace( QRegExp( "<\\s*a\\s*href\\s*=\\s*'(w:|s:){0,1}([^#](?!ttp://)[^']*)(.)" ),
|
||||
"<a href=\"bword:\\2\"");
|
||||
|
||||
// Anchors
|
||||
text.replace( QRegExp( "<a href=\"bword:([^#\"]+)#([^\"]+)" ),
|
||||
"<a href=\"gdlookup://localhost/\\1?gdanchor=\\2" );
|
||||
|
||||
static QRegExp self_closing_divs( "(<div\\s[^>]*)/>", Qt::CaseInsensitive ); // <div ... />
|
||||
text.replace( self_closing_divs, "\\1></div>" );
|
||||
|
||||
|
|
Loading…
Reference in a new issue