From 6151c914f5b60c13875c11df52ecbd8cc936b09d Mon Sep 17 00:00:00 2001 From: Xiao YiFang Date: Thu, 2 Mar 2023 21:23:01 +0800 Subject: [PATCH] fix:wikipedia url request --- mediawiki.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mediawiki.cc b/mediawiki.cc index ca6359de..9a8a92b3 100644 --- a/mediawiki.cc +++ b/mediawiki.cc @@ -617,6 +617,10 @@ void MediaWikiArticleRequest::requestFinished( QNetworkReply * r ) // Add url scheme to other urls like "//xxx" articleString.replace( " href=\"//", " href=\"" + wikiUrl.scheme() + "://" ); + // Add url scheme to other urls like embed css background: url("//upload.wikimedia.org/wikipedia/commons/6/65/Lock-green.svg")right 0.1em center/9px no-repeat + articleString.replace( "url(\"//", "url(\"" + wikiUrl.scheme() + "://" ); + + // Fix urls in "srcset" attribute pos = 0; QRegularExpression regSrcset( R"( srcset\s*=\s*"/[^"]+")" );