diff --git a/src/utils.js b/src/utils.js index 0e5961d..835ec49 100644 --- a/src/utils.js +++ b/src/utils.js @@ -140,6 +140,12 @@ module.exports = function(redis) { } } + // add the lang query param to forms + let forms = data.html.querySelectorAll('form') + for(let i = 0; i < forms.length; i++) { + forms[i].insertAdjacentHTML('afterbegin', ``) + } + // remove #p-wikibase-otherprojects let wikibase_links = data.html.querySelector('#p-wikibase-otherprojects') if(wikibase_links) { @@ -201,18 +207,6 @@ module.exports = function(redis) { const wiki_href_regx = /(href=\"(https:|http:|)\/\/([A-z.-]+\.)?(wikipedia.org|wikimedia.org|wikidata.org|mediawiki.org))/gm data.html = data.html.replace(wiki_href_regx, 'href="') - /** - * If we are on DownloadAsPdf page, we have to inject a input which - * holds the language value. Without this input, we can't access the - * language (not avail from the POST data). - * See more on https://codeberg.org/orenom/Wikiless/issues/9 - */ - if(url.includes('%3ADownloadAsPdf')) { - let lang_input = `` - let replace_str = `