User:Smith609/enDashes.js

if (document.getElementById("wpTextbox1") && mw.config.get('wgCanonicalNamespace') != "Template"){

spaces = /(\s)-(\s)/g;

document.getElementById("wpTextbox1").innerHTML = document.getElementById("wpTextbox1").innerHTML.replace(spaces, "$1–$2");

}