mirror of
https://github.com/kiwix/kiwix-js-pwa.git
synced 2025-09-09 12:19:46 -04:00
Workaround for misplaced homonymie hatnotes in French Wikipedia
See https://github.com/openzim/mwoffliner/issues/182 Former-commit-id: 127a9972d35309f6fc9e4758fca23c138a328242 [formerly cdb085d280f76c37b7fbceb092d9f158a884170c] Former-commit-id: 1aadf0b1ad19958dfbd87bc356e8aedaaa46090e
This commit is contained in:
parent
ba9aead18c
commit
6b09a663b3
@ -1677,7 +1677,7 @@ define(['jquery', 'zimArchiveLoader', 'util', 'uiUtil', 'cookies', 'q', 'module'
|
||||
htmlArticle = htmlArticle.replace(/<span\b[^>]+>[^/]*?User:Popo[^<]+<\/span>\s*/i, "");
|
||||
|
||||
//Put misplaced hatnote headers inside <h1> block back in correct position @TODO remove this when fixed in mw-offliner
|
||||
var hatnote = htmlArticle.match(/<h1\b(?:[^<]|<(?!h2))+?((?:<div\s+[^>]+\bhatnote\b[\s\S]+?<\/div>\s*)+)/i);
|
||||
var hatnote = htmlArticle.match(/<h1\b(?:[^<]|<(?!h2))+?((?:<div\s+[^>]+\b(?:hatnote|homonymie)\b[\s\S]+?<\/div>\s*)+)/i);
|
||||
if (hatnote && hatnote.length > 1) {
|
||||
htmlArticle = htmlArticle.replace(hatnote[1], "");
|
||||
htmlArticle = htmlArticle.replace(/(<\/h1>\s*)/i, "$1" + hatnote[1].replace(/(<div\s+)/i,'$1style="padding-top:10px;" '));
|
||||
|
Loading…
x
Reference in New Issue
Block a user