From 2d0dd806f19a997ecec17c0dfafb3ee8d4d209a1 Mon Sep 17 00:00:00 2001 From: Jaifroid Date: Tue, 11 May 2021 09:29:01 +0100 Subject: [PATCH] Fix subtitles and media download Former-commit-id: 40b838098ce913dd7d285fdfab5c9b4817e7b7ec [formerly 462f9114eeed8cdadf0b8f795cff62efb6f0fe77 [formerly 5191fb4a99aece1d0cd015204cf496a1418f9f45]] Former-commit-id: 74b41d33d653e7ed16d6ab084b99fd5594c33b63 Former-commit-id: 9f6abd5c077893dad3ffbdd6a82f913017c2bd85 --- www/js/app.js | 105 ++++++++++++++++++++++++++------------------------ 1 file changed, 54 insertions(+), 51 deletions(-) diff --git a/www/js/app.js b/www/js/app.js index ef5d663d..97d7a9ab 100644 --- a/www/js/app.js +++ b/www/js/app.js @@ -3228,13 +3228,13 @@ define(['jquery', 'zimArchiveLoader', 'uiUtil', 'util', 'cache', 'images', 'sett var regexpPath = /^(.*\/)[^\/]+$/; // Pattern to find a ZIM URL (with its namespace) - see https://wiki.openzim.org/wiki/ZIM_file_format#Namespaces var regexpZIMUrlWithNamespace = /^[./]*([-ABCIJMUVWX]\/.+)$/; - // Regex below finds images, scripts, stylesheets and tracks with ZIM-type metadata and image namespaces [kiwix-js #378]. + // Regex below finds images, scripts, stylesheets (not tracks) with ZIM-type metadata and image namespaces [kiwix-js #378]. // It first searches for ]*?\s)(?:src|href)(\s*=\s*(["']))(?!http|app:)(.+?)(?=\3|\?|#)/ig; + var regexpTagsWithZimUrl = /(<(?:img|script|link)\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