User:Aidan9382/scripts/quickfix-enclose.js

/* Unused: Category:Pages using deprecated enclose attributes has been cleared */ var ef = document.editform, tb = ef.wpTextbox1, es = ef.wpSummary; if (tb && tb.style.length == 0 && !(document.title.indexOf(".js") > -1 && document.title.indexOf(" talk:") == -1) && !es.value) { if (tb.value && tb.value.search("enclose=") > -1) { //I dont do JS, so lets just be inefficient tb.value = tb.value.replaceAll(" enclose=none"," inline"); tb.value = tb.value.replaceAll("|enclose=none","|inline=1"); tb.value = tb.value.replaceAll(" enclose=\"none\""," inline"); tb.value = tb.value.replaceAll("|enclose=\"none\"","|inline=1"); tb.value = tb.value.replaceAll(" enclose=div",""); tb.value = tb.value.replaceAll("|enclose=div",""); tb.value = tb.value.replaceAll(" enclose=\"div\"",""); tb.value = tb.value.replaceAll("|enclose=\"div\"",""); tb.value = tb.value.replaceAll(" enclose=pre",""); tb.value = tb.value.replaceAll("|enclose=pre",""); tb.value = tb.value.replaceAll(" enclose=\"pre\"",""); tb.value = tb.value.replaceAll("|enclose=\"pre\"",""); es.value = "Category:Pages using deprecated enclose attributes (Via js script)"; } }