mirror of
https://github.com/kiwix/kiwix-js-pwa.git
synced 2025-09-09 12:19:46 -04:00
Very dirty patch for HTML showing in Wikivoyage headings on some pages
See https://github.com/openzim/mwoffliner/issues/178 Former-commit-id: daeadbb483b6b3322a0ea2f83ad6f0dfcbf17a20 [formerly ca6ae28c6f4dbc2f24cc29da3913d9b153f36c92] Former-commit-id: 3f9cb5eba145576be9c923cba2becc556e5f5e30
This commit is contained in:
parent
5958c118e2
commit
1eb9da18fb
@ -1553,7 +1553,10 @@ define(['jquery', 'zimArchiveLoader', 'util', 'uiUtil', 'cookies', 'abstractFile
|
||||
|
||||
//Some documents (e.g. Ray Charles Index) can't be scrolled to the very end, as some content remains benath the footer
|
||||
//so add some whitespace at the end of the document
|
||||
htmlArticle = htmlArticle.replace(/(<\/body>)/i, "<p> </p><p> </p><p> </p><p> </p>\r\n$1");
|
||||
htmlArticle = htmlArticle.replace(/(dditional terms may apply for the media files[^<]+<\/div>\s*)/i, "$1\r\n<p> </p><p> </p><p> </p><p> </p>\r\n");
|
||||
|
||||
//@TODO - remove this when issue fixed: VERY DIRTY PATCH FOR HTML IN PAGE TITLES on Wikivoyage
|
||||
htmlArticle = htmlArticle.replace(/<a href[^"]+"\/wiki\/([^"]+)[^<]+>([^<]+)<\/a>/ig, "<a href=\"$1.html\">$2</a>");
|
||||
|
||||
//Fast-replace img src with data-kiwixsrc and hide image [kiwix-js #272]
|
||||
htmlArticle = htmlArticle.replace(/(<img\s+[^>]*\b)src(\s*=)/ig, "$1data-kiwixsrc$2");
|
||||
|
Loading…
x
Reference in New Issue
Block a user