mirror of
https://github.com/kiwix/kiwix-js-pwa.git
synced 2025-09-12 13:58:28 -04:00
Works around misplacement of noexcerpt disambiguation note
See https://github.com/openzim/mwoffliner/issues/182 Former-commit-id: 99389e97f3cfd4062aef2d4b67c2ca6966f6fdff [formerly 3864eb7b4b5fc139c0ea2f0e92588db211790eb3] Former-commit-id: 6f581cc64cd03944da04817a6f118ac1b55a9c33
This commit is contained in:
parent
a58251beed
commit
5f22f89ffd
@ -1608,6 +1608,12 @@ define(['jquery', 'zimArchiveLoader', 'util', 'uiUtil', 'cookies', 'q', 'module'
|
|||||||
htmlArticle = htmlArticle.replace(hatnote, "");
|
htmlArticle = htmlArticle.replace(hatnote, "");
|
||||||
htmlArticle = htmlArticle.replace(/(<\/h1>\s*)/i, "$1" + hatnote);
|
htmlArticle = htmlArticle.replace(/(<\/h1>\s*)/i, "$1" + hatnote);
|
||||||
}
|
}
|
||||||
|
//Put misplaced disambiguation header back in its correct position @TODO remove this when fixed in mw-offliner
|
||||||
|
var noexcerpt = htmlArticle.match(/<dl>(?:[^<]|<(?!\/dl>))+?excerpt(?:[^<]|<(?!\/dl>))+?For other places with the same name(?:[^<]|<(?!\/dl>))+?<\/dl>\s*/i);
|
||||||
|
if (noexcerpt && noexcerpt.length) {
|
||||||
|
htmlArticle = htmlArticle.replace(noexcerpt, "");
|
||||||
|
htmlArticle = htmlArticle.replace(/(<\/h1>\s*)/i, "$1" + noexcerpt);
|
||||||
|
}
|
||||||
|
|
||||||
//TESTING - find out whether document contains MathSVGs
|
//TESTING - find out whether document contains MathSVGs
|
||||||
//var containsMathSVG = /\.svg\s*['"][^>]+mwe-math-fallback-image|mwe-math-fallback-image[^>]+\.svg\s*['"]/i.test(htmlArticle);
|
//var containsMathSVG = /\.svg\s*['"][^>]+mwe-math-fallback-image|mwe-math-fallback-image[^>]+\.svg\s*['"]/i.test(htmlArticle);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user