Skip to content

Commit

Permalink
Repair wikitext
Browse files Browse the repository at this point in the history
  • Loading branch information
avindra committed Sep 14, 2021
1 parent bf7d9c4 commit 4e2e87c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions contrib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ function createLimit() {
/**
* @see https://www.mediawiki.org/w/index.php?title=Topic:Uf4krdlgla2ofhg8&topic_showPostId=ufaoyapift6qlhrg#flow-post-ufaoyapift6qlhrg
*/
async function getHTML() {
async function getHTML(wikitext) {
await mw.loader.using( 'mediawiki.api' );
const api = new mw.Api();

const html = await api.parse( "'''Hello world'''" );
const html = await api.parse( wikitext);
return html;
}

Expand Down Expand Up @@ -71,7 +71,7 @@ export const register = () => {

if (nextPage) {
const btn = document.createElement('button');
btn.textContent = 'Oldrrrr';
btn.textContent = 'Older';
const P = nav.parentNode;
const limiter = createLimit();
const onChange = (event) => {
Expand All @@ -94,6 +94,7 @@ export const register = () => {

const viewFiles = document.createElement('button');
viewFiles.onclick = async function () {
this.disabled = true;
const files = Array.from(document.querySelectorAll(".mw-contributions-title")).map(a => a.textContent);
const f = files.sort().map(f => {
if (f.startsWith("File:")) {
Expand All @@ -107,6 +108,7 @@ export const register = () => {
const sp = document.createElement('span');
sp.innerHTML = html;
document.body.appendChild(sp);
this.disabled = false;
};
viewFiles.textContent = "🔍";
P.prepend(viewFiles);
Expand Down

0 comments on commit 4e2e87c

Please sign in to comment.