From 3f6834aa5af53723174de27748e35a67c28d101b Mon Sep 17 00:00:00 2001 From: Jaifroid Date: Tue, 11 Feb 2025 07:06:12 +0000 Subject: [PATCH] Fix repeated title in latest Wikivoyage ZIMs #690 (#691) --- www/js/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/js/app.js b/www/js/app.js index c5451ae7..3fb98ba4 100644 --- a/www/js/app.js +++ b/www/js/app.js @@ -6178,7 +6178,7 @@ function displayArticleContentInContainer (dirEntry, htmlArticle) { htmlArticle = htmlArticle.replace(/(]+\/site\.js["']><\/script>\s*)((?:[^<]|<(?!\/body))+)/, '$2$1'); // @TODO Remove when fixed in https://github.com/openzim/mwoffliner/issues/1872 // Add missing title to WikiMedia articles for post June 2023 scrapes - htmlArticle = !params.isLandingPage && !/]+(?:section-heading|article-header)/i.test(htmlArticle) ? htmlArticle.replace(/(]+>\s*)/i, '$1

' + dirEntry.getTitleOrUrl().replace(/</g, '<') + '

') : htmlArticle; + htmlArticle = !params.isLandingPage && !/]+(?:section-heading|section-title|article-header)/i.test(htmlArticle) ? htmlArticle.replace(/(]+>\s*)/i, '$1

' + dirEntry.getTitleOrUrl().replace(/</g, '<') + '

') : htmlArticle; // Remove hard-coded image widths for new mobile-html endpoint ZIMs htmlArticle = htmlArticle.replace(/(]+?width=)[^>]+?height=['"][^'"]+?['"]/ig, '$1$2"320px"'); htmlArticle = htmlArticle.replace(/(]+(?:min-width:\s*|width=['"]))(\d+px)([^>]+>\s*]+style=['"])/ig, '$1$2$3max-width: $2; ');