İçeriğe atla

Kullanıcı:Kahve6/RETF

Vikipedi, özgür ansiklopedi

The RegExTypoFix script makes it easy to perform every typo fix rule listed on Project:AutoWikiBrowser/Typos for the wiki it's run from. If the typos page doesn't exist on the wiki it's run from, it doesn't work though. It can be imported into any script, and used by simply running the following after the script has loaded:

RETF.replace("exmaple peice of mispelled text"); //returns "example piece of misspelled text"

Any piece of text can be entered into that funcion, and it will automatically fix all typos found in it. The typo rules will not be applied to image names, template names and parameters, quotes, and any text following a colon or asterisk, as well as skipping any rule that also matches a wikilink target on that page. Also note that, since JavaScript does not support lookbehinds, any replacement rules containing lookbehinds (?<= and ?<!) will be ignored.

To reload the typos list, simply run the following code:

RETF.load();

which will re-evaluate all rules on the typos page. This will remove the rules that were removed from the page too.


Click here for an applied example of this script.