Code that you insert on this page could contain malicious content capable of compromising your account. If you import a script from another page with "importScript", "mw.loader.load", "iusc", or "lusc", take note that this causes you to dynamically load a remote script, which could be changed by others. Editors are responsible for all edits and actions they perform, including by scripts. User scripts are not centrally supported and may malfunction or become inoperable due to software changes. A guide to help you find broken scripts is available. If you are unsure whether code you are adding to this page is safe, you can ask at the appropriate village pump. This code will be executed when previewing this page.
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
/** * This script is an indepedently-usable AutoEd module. If you already have AutoEd installed, please see [[Wikipedia:AutoEd/Customization]] for how to load this module. If you don't have AutoEd installed, then you don't need to do anything; just install this script the normal way. * Known false positive occurs when interlanguage link is placed after a template invocation within a citation template. Make sure this does not happen by checking the page preview for errors. */functionautoEdwIll(str){str=str.replace(/\[https?:\/\/([^\.]*)\.(?:m\.)?wikipedia\.org\/wiki\/(\S*)(?:\s*([^\]]*)])/g,(match,p1,p2,p3)=>{if(p3===undefined){return`[[:${p1}:${p2}]]`;}return`[[:${p1}:${p2}|${p3}]]`;});str=str.replace(/(?<!{{\s*cit[^}]*)\[\[:(.*?):([^|\]]*)(?:\|([^\]]*))?]]/g,(match,p1,p2,p3)=>{if(p3===undefined){return`{{ill|${p2}|${p1}}}`;}return`{{ill|${p3}|${p1}|${p2}}}`;});returnstr;}$.when($.ready).then(()=>{if(importScript('Wikipedia:AutoEd/core.js')){// if not otherwise using AutoEdconsole.log('imported');window.autoEdFunctions=function(){const$box=$('#wpTextbox1');conststr=$box.textSelection('getContents');constnewstr=autoEdwIll(str);if(newstr!==str){// don't confuse or tag if no fixes$box.textSelection('setContents',newstr);}else{autoEdTag='';autoEdClick=false;mw.notify('No changes needed!');}};autoEdMinor=false;autoEdLinkName='AutowIll';autoEdLinkHover='Automatically wikify and template straightforward foreign-language links';autoEdTag='converted foreign-language links to use {{ill}} with [[User:Aaron Liu/AutowIll.js]]';}});