From cf3ec5dfc1c236d2475b1d59c54ae0d0a163c468 Mon Sep 17 00:00:00 2001 From: Abs62 Date: Sat, 31 Oct 2015 22:26:50 +0300 Subject: [PATCH] Wiki: Handle inter-article anchors --- mediawiki.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mediawiki.cc b/mediawiki.cc index f9b47751..1b3c4289 100644 --- a/mediawiki.cc +++ b/mediawiki.cc @@ -358,7 +358,11 @@ void MediaWikiArticleRequest::requestFinished( QNetworkReply * r ) int n = link.indexOf( '#', 1 ); if( n > 0 ) + { + QString anchor = link.mid( n + 1 ).replace( '_', "%5F" ); link.truncate( n ); + link += QString( "?gdanchor=%1" ).arg( anchor ); + } QString newLink = QString( "