Commit d479c78b authored by George Dietrich's avatar George Dietrich Committed by Yunhe Guo
Browse files

Fully future proof the image URL pattern

parent 7230692f
......@@ -42,7 +42,7 @@ void NatGeoProvider::pageRequestFinished(KJob *_job)
QString url;
re.setPattern(QStringLiteral("<meta.*property=\"og:image\".*?content=\"(.*?)\".*/>"));
re.setPattern(QStringLiteral("<meta\\s+(?:\\S+=[\"']?(?:.(?![\"']?\\s+(?:\\S+)=|\\s*/?[>\"']))+.[\"']?\\s*)*property=\"og:image\"\\s*(?:\\S+=[\"']?(?:.(?![\"']?\\s+(?:\\S+)=|\\s*/?[>\"']))+.[\"']?\\s*)*content=[\"']?((?:.(?![\"']?\\s+(?:\\S+)=|\\s*/?[>\"']))+.)[\"']?\\s*(?:\\S+=[\"']?(?:.(?![\"']?\\s+(?:\\S+)=|\\s*/?[>\"']))+.[\"']?\\s*)*/>"));
for (int i = 0; i < lines.size(); i++) {
QRegularExpressionMatch match = re.match(lines.at(i));
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment