From 14aebab45fae0ac8cb59643e5502a62a0dae9d2c Mon Sep 17 00:00:00 2001 From: Jaifroid Date: Sun, 14 Feb 2021 16:22:41 +0000 Subject: [PATCH] Implement app:// links Former-commit-id: ff15b66ac35bdb6299161ce28e6b10fd35d5485c [formerly 2a9ae3a2f8f21b98cee7fa3ad76373e6985f135b [formerly bb46b193feb478c21d8da955a7399b64e7a337cb]] Former-commit-id: 0ae9b105f136e965045a21afecac89572a365a67 Former-commit-id: 14779e41a52aa29126013b4b46d1eca9775b0328 --- www/js/app.js | 9 ++++++--- www/js/init.js | 7 ++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/www/js/app.js b/www/js/app.js index c1285010..8be5e0cf 100644 --- a/www/js/app.js +++ b/www/js/app.js @@ -3080,7 +3080,7 @@ define(['jquery', 'zimArchiveLoader', 'uiUtil', 'util', 'cache', 'images', 'sett // URLs that begin 'http' (i.e. non-relative URLs). It then captures the whole of the URL up until either the opening delimiter // (" or ', which is capture group \3) or a querystring or hash character (? or #). When the regex is used below, it will be further // processed to calculate the ZIM URL from the relative path. This regex can cope with legitimate single quote marks (') in the URL. - var regexpTagsWithZimUrl = /(<(?:img|script|link|track)\b[^>]*?\s)(?:src|href)(\s*=\s*(["']))(?!http)(.+?)(?=\3|\?|#)/ig; + var regexpTagsWithZimUrl = /(<(?:img|script|link|track)\b[^>]*?\s)(?:src|href)(\s*=\s*(["']))(?!http|app:)(.+?)(?=\3|\?|#)/ig; // Regex below tests the html of an article for active content [kiwix-js #466] // It inspects every