Wiki: Handle inter-article anchors

This commit is contained in:
Abs62 2015-10-31 22:26:50 +03:00
parent 81d56b73f9
commit cf3ec5dfc1

View file

@ -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( "<a href=\"/%1\"" ).arg( link );
articleString.replace( pos, regLinks.cap().size(), newLink );