I have an RTL (Hebrew) MediaWiki 1.34.0 website in which I am having a serious problem creating footnotes for articles with the core Extension:Cite because its de-facto lack of support in Hebrew, as described in great depth here:
Therefore, I thought of the following alternative approach;
Creating a JavaScript front end alternative to created footnotes in a similar way to that of MediaWiki Cite
It should run after enabling support in raw HTML (and after heeding associated warnings):
The code should look approximately like this (unfinished code):
Template:Footnote
תבנית:הערה
<includeonly><span dir="rtl" class="footnote"><sup class="footnote_inner">{{{1}}}</sup></span></includeonly><noinclude> [[קטגוריה:תבניות]] </noinclude>
JavaScript
document.querySelectorAll(".footnote>sup").forEach((element, i) => { const li = document.createElement("li"); li.append(...element.childNodes); element.textContent = i + 1; const footnotes_list = document.querySelector(".footnotes_list"); footnotes_list.appendChild(li); }); const numbers = Array.from(Array(100)).map((e,i)=>i+1) document.querySelectorAll(".footnote").forEach( (element, i)=>{ element.setAttribute("href", `#footnote_${numbers[i]}`) element.setAttribute("id", "fn_"+numbers[i]); }); document.querySelectorAll(".footnotes_list>li").forEach( (element, i)=>{ element.setAttribute("id", "footnote_"+numbers[i]); element.setAttribute("href", `#fn_${numbers[i]}`) });
Lets say I do create a 100% working code,
A question remains:
Is it SEO problematic to create footnotes with JavaScript (in MediaWiki websites)?