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