From 249db51e868ec0db80f43e715be810dfbe9a8013 Mon Sep 17 00:00:00 2001 From: Abs62 Date: Sun, 25 Sep 2016 15:51:21 +0300 Subject: [PATCH] MDict: Fix handling of external links to images (issue #761) --- mdx.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mdx.cc b/mdx.cc index a8693a2d..52f84b59 100644 --- a/mdx.cc +++ b/mdx.cc @@ -1016,10 +1016,10 @@ QString & MdxDictionary::filterResource( QString const & articleId, QString & ar Qt::CaseInsensitive, QRegExp::RegExp2 ), "\\1\"bres://" + id + "/\\\"" ) // images - .replace( QRegExp( "(<\\s*img\\s+[^>]*\\bsrc\\b\\s*=\\s*[\"']+)(?:file://)?[\\x00-\\x1f\\x7f]*([^\"']*)", + .replace( QRegExp( "(<\\s*img\\s+[^>]*\\bsrc\\b\\s*=\\s*[\"']+)(?!http:|https:)(?:file://)?[\\x00-\\x1f\\x7f]*([^\"']*)", Qt::CaseInsensitive, QRegExp::RegExp2 ), "\\1bres://" + id + "/\\2" ) - .replace( QRegExp( "(<\\s*img\\s+[^>]*\\bsrc\\b\\s*=\\s*)(?!['\"]+)(?!bres:|data:)(?:file://)?([^\\s>]+)", + .replace( QRegExp( "(<\\s*img\\s+[^>]*\\bsrc\\b\\s*=\\s*)(?!['\"]+)(?!bres:|data:|http:|https:)(?:file://)?([^\\s>]+)", Qt::CaseInsensitive, QRegExp::RegExp2 ), "\\1\"bres://" + id + "/\\2\"" );