Anoter misplaced hatnote

Former-commit-id: 4020fec7a6648c41cec4fa3f01c98a6679112436 [formerly 39a0fc81b9214768a9ea4745f60d5ea19549e28a]
Former-commit-id: a1dfc680a75e150fdd025aa9d2769061f5116015
This commit is contained in:
Jaifroid 2018-04-09 22:34:59 +01:00
parent d175a08f06
commit 4e86cc7ce0

View File

@ -1896,7 +1896,7 @@ define(['jquery', 'zimArchiveLoader', 'util', 'uiUtil', 'cookies', 'q', 'module'
htmlArticle = htmlArticle.replace(/(<\/h1>\s*)/i, "$1" + hatnote[1].replace(/(<div\s+)/i,'$1style="padding-top:10px;" '));
}
//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);
var noexcerpt = htmlArticle.match(/<dl\b(?:[^<]|<(?!\/dl>))+?(?:For other places with the same name|Not to be confused with)(?:[^<]|<(?!\/dl>))+?<\/dl>\s*/i);
if (noexcerpt && noexcerpt.length) {
htmlArticle = htmlArticle.replace(noexcerpt, "");
htmlArticle = htmlArticle.replace(/(<\/h1>\s*)/i, "$1" + noexcerpt);