Aard: Handle inter-article anchors

This commit is contained in:
Abs62 2015-11-03 01:38:00 +03:00
parent d500b3d6e7
commit 5018f384f4

View file

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