User:Vildricianus/replace.js

//

// confer User:Vildricianus/Format for an explanation // included in main file User:Vildricianus/monobook.js

// ================================================================ // furious text replacement script -- be friendly, it may bite // partly nicked from User:Connel MacKenzie/monobook.js // firefox with QuickJava extension may be useful, // as it allows one-click javascript switch off // ================================================================

function textReplace { var oldtext = txt; // very first position txt = txt.replace(/ /g, " "); txt = txt.replace(/ \n/g, "\n");

// comments txt = txt.replace(/\n\<\!--languages from J to Z go here--\>/g, ""); txt = txt.replace(/\n\<\!--languages from A to I go here--\>/g, ""); txt = txt.replace(/\<\!--languages from J to Z go here--\>/g, ""); txt = txt.replace(/\<\!--languages from A to I go here--\>/g, "");

// parentheses & colons //txt = txt.replace(/\'\'\(/g, "(''"); //txt = txt.replace(/\)\'\'/g, "'')"); //txt = txt.replace(/\):\'\'/g, "''):"); //remove colon later on // txt = txt.replace(/\}:/g, "}"); //conflict: : // txt = txt.replace(/\):/g, ")"); //conflict: (Cantonese):

// removing/adding spaces txt = txt.replace(/ : /g, ": "); txt = txt.replace(/:\[/g, ": ["); txt = txt.replace(/\* \[/g, "*["); txt = txt.replace(/\* \{/g, "*{"); txt = txt.replace(/\=\= /g, "=="); txt = txt.replace(/ \=\=/g, "==");

// undo bad change //txt = txt.replace(/\'\'\)\'/g, ")'''"); //txt = txt.replace(/\'\(\'\'/g, "'''(");

// # + space txt = txt.replace(/\n#a/gi, "\n# A"); txt = txt.replace(/\n#b/gi, "\n# B"); txt = txt.replace(/\n#c/gi, "\n# C"); txt = txt.replace(/\n#d/gi, "\n# D"); txt = txt.replace(/\n#e/gi, "\n# E"); txt = txt.replace(/\n#f/gi, "\n# F"); txt = txt.replace(/\n#g/gi, "\n# G"); txt = txt.replace(/\n#h/gi, "\n# H"); txt = txt.replace(/\n#i/gi, "\n# I"); txt = txt.replace(/\n#j/gi, "\n# J"); txt = txt.replace(/\n#k/gi, "\n# K"); txt = txt.replace(/\n#l/gi, "\n# L"); txt = txt.replace(/\n#m/gi, "\n# M"); txt = txt.replace(/\n#n/gi, "\n# N"); txt = txt.replace(/\n#o/gi, "\n# O"); txt = txt.replace(/\n#p/gi, "\n# P"); txt = txt.replace(/\n#q/gi, "\n# Q"); txt = txt.replace(/\n#r/gi, "\n# R"); txt = txt.replace(/\n#s/gi, "\n# S"); txt = txt.replace(/\n#t/gi, "\n# T"); txt = txt.replace(/\n#u/gi, "\n# U"); txt = txt.replace(/\n#v/gi, "\n# V"); txt = txt.replace(/\n#w/gi, "\n# W"); txt = txt.replace(/\n#x/gi, "\n# X"); txt = txt.replace(/\n#y/gi, "\n# Y"); txt = txt.replace(/\n#z/gi, "\n# Z"); txt = txt.replace(/\n# a/gi, "\n# A"); txt = txt.replace(/\n# b/gi, "\n# B"); txt = txt.replace(/\n# c/gi, "\n# C"); txt = txt.replace(/\n# d/gi, "\n# D"); txt = txt.replace(/\n# e/gi, "\n# E"); txt = txt.replace(/\n# f/gi, "\n# F"); txt = txt.replace(/\n# g/gi, "\n# G"); txt = txt.replace(/\n# h/gi, "\n# H"); txt = txt.replace(/\n# i/gi, "\n# I"); txt = txt.replace(/\n# j/gi, "\n# J"); txt = txt.replace(/\n# k/gi, "\n# K"); txt = txt.replace(/\n# l/gi, "\n# L"); txt = txt.replace(/\n# m/gi, "\n# M"); txt = txt.replace(/\n# n/gi, "\n# N"); txt = txt.replace(/\n# o/gi, "\n# O"); txt = txt.replace(/\n# p/gi, "\n# P"); txt = txt.replace(/\n# q/gi, "\n# Q"); txt = txt.replace(/\n# r/gi, "\n# R"); txt = txt.replace(/\n# s/gi, "\n# S"); txt = txt.replace(/\n# t/gi, "\n# T"); txt = txt.replace(/\n# u/gi, "\n# U"); txt = txt.replace(/\n# v/gi, "\n# V"); txt = txt.replace(/\n# w/gi, "\n# W"); txt = txt.replace(/\n# x/gi, "\n# X"); txt = txt.replace(/\n# y/gi, "\n# Y"); txt = txt.replace(/\n# z/gi, "\n# Z");

txt = txt.replace(/\n#:\'\'\'Quotations\'\'\'/gi, "");

txt = txt.replace(/\n#\[/g, "\n# ["); txt = txt.replace(/\n#\{/g, "\n# {"); txt = txt.replace(/\n#\(/g, "\n# ("); txt = txt.replace(/\n#\'/g, "\n# '"); txt = txt.replace(/\n#:\'\'/g, "\n#: ''"); txt = txt.replace(/\n#:\*/g, "\n#*");

// changing to templates, removing colons // scan for colons first position // parentheses weirdness gets fixed in first section txt = txt.replace(/\(\'\'intransitive\'\'\):/gi, ""); txt = txt.replace(/\(\'\'intransitive\'\'\)/gi, ""); txt = txt.replace(/\(\'\'transitive\'\'\):/gi, ""); txt = txt.replace(/\(\'\'transitive\'\'\)/gi, ""); txt = txt.replace(/\(\'\'transitive and intransitive\'\'\):/gi, " & "); txt = txt.replace(/\(\'\'transitive and intransitive\'\'\)/gi, " & "); txt = txt.replace(/\(\'\'intransitive and transitive\'\'\):/gi, " & "); txt = txt.replace(/\(\'\'intransitive and transitive\'\'\)/gi, " & "); txt = txt.replace(/\(\'\'reflexive\'\'\):/gi, ""); txt = txt.replace(/\(\'\'reflexive\'\'\)/gi, "");

txt = txt.replace(/\[\[countable\]\]:/gi, ""); txt = txt.replace(/\[\[uncountable\]\]:/gi, ""); txt = txt.replace(/\(\'\'countable\'\'\):/gi, ""); txt = txt.replace(/\(\'\'countable\'\'\)/gi, ""); txt = txt.replace(/\(\'\'uncountable\'\'\):/gi, ""); txt = txt.replace(/\(\'\'uncountable\'\'\)/gi, ""); txt = txt.replace(/\(\'\'\[\[uncountable\]\]\'\'\)/gi, ""); txt = txt.replace(/\(\'\'\[\[uncountable noun\]\]\'\'\)/gi, ""); txt = txt.replace(/\(\[\[uncountable\]\]\)/gi, ""); txt = txt.replace(/\(\[\[uncountable noun\]\]\)/gi, ""); txt = txt.replace(/\(\'\'\[\[countable\]\]\'\'\)/gi, ""); txt = txt.replace(/\(\'\'\[\[countable noun\]\]\'\'\)/gi, ""); txt = txt.replace(/\(\[\[countable\]\]\)/gi, ""); txt = txt.replace(/\(\[\[countable noun\]\]\)/gi, "");

txt = txt.replace(/# \(\'\'archaic\'\'\):/gi, "# "); txt = txt.replace(/# \(\'\'archaic\'\'\)/gi, "# "); txt = txt.replace(/# \(\'\'dated\'\'\):/gi, "# "); txt = txt.replace(/# \(\'\'dated\'\'\)/gi, "# "); txt = txt.replace(/# \(\'\'obsolete\'\'\):/gi, "# "); txt = txt.replace(/# \(\'\'obsolete\'\'\)/gi, "# "); txt = txt.replace(/# \(\'\'vulgar\'\'\):/gi, "# "); txt = txt.replace(/# \(\'\'vulgar\'\'\)/gi, "# "); txt = txt.replace(/# \(\'\'rare\'\'\):/gi, "# "); txt = txt.replace(/# \(\'\'rare\'\'\)/gi, "# "); txt = txt.replace(/# \(\'\'slang\'\'\):/gi, "# "); txt = txt.replace(/# \(\'\'slang\'\'\)/gi, "# "); txt = txt.replace(/# \(\'\'formal\'\'\):/gi, "# "); txt = txt.replace(/# \(\'\'formal\'\'\)/gi, "# "); txt = txt.replace(/# \(formal\)/gi, "# "); txt = txt.replace(/# \(\'\'informal\'\'\):/gi, "# "); txt = txt.replace(/# \(\'\'informal\'\'\)/gi, "# "); txt = txt.replace(/# \(informal\)/gi, "# "); txt = txt.replace(/# \(\'\'US\'\'\):/gi, "# 🇺🇸"); txt = txt.replace(/# \(\'\'US\'\'\)/gi, "# 🇺🇸"); txt = txt.replace(/# \(\'\'UK\'\'\):/gi, "# "); txt = txt.replace(/# \(\'\'UK\'\'\)/gi, "# "); txt = txt.replace(/# \(\'\'colloquial\'\'\):/gi, "# "); txt = txt.replace(/# \(\'\'colloquial\'\'\)/gi, "# "); txt = txt.replace(/# \(\'\'euphemism\'\'\):/gi, "# "); txt = txt.replace(/# \(\'\'euphemism\'\'\)/gi, "# "); txt = txt.replace(/# \(\'\'figurative\'\'\):/gi, "# "); txt = txt.replace(/# \(\'\'figurative\'\'\)/gi, "# "); txt = txt.replace(/# \(\'\'figuratively\'\'\):/gi, "# "); txt = txt.replace(/# \(\'\'figuratively\'\'\)/gi, "# "); txt = txt.replace(/# \(\'\'fig\'\'\):/gi, "# "); txt = txt.replace(/# \(\'\'fig\'\'\)/gi, "# ");

// topics, listed alphabetically txt = txt.replace(/\(\'\'advertising\'\'\):/gi, ""); txt = txt.replace(/\(\'\'advertising\'\'\)/gi, ""); txt = txt.replace(/\(\'\'algebra\'\'\):/gi, ""); txt = txt.replace(/\(\'\'algebra\'\'\)/gi, ""); txt = txt.replace(/\(\'\'archaeology\'\'\):/gi, ""); txt = txt.replace(/\(\'\'archaeology\'\'\)/gi, ""); txt = txt.replace(/\(\'\'architecture\'\'\):/gi, ""); txt = txt.replace(/\(\'\'architecture\'\'\)/gi, ""); txt = txt.replace(/\(\'\'arithmetic\'\'\):/gi, ""); txt = txt.replace(/\(\'\'arithmetic\'\'\)/gi, ""); txt = txt.replace(/\(\'\'art\'\'\):/gi, ""); txt = txt.replace(/\(\'\'art\'\'\)/gi, ""); txt = txt.replace(/\(\'\'astrology\'\'\):/gi, ""); txt = txt.replace(/\(\'\'astrology\'\'\)/gi, ""); txt = txt.replace(/\(\'\'biology\'\'\):/gi, ""); txt = txt.replace(/\(\'\'biology\'\'\)/gi, ""); txt = txt.replace(/\(\'\'botany\'\'\):/gi, ""); txt = txt.replace(/\(\'\'botany\'\'\)/gi, ""); txt = txt.replace(/\(\'\'chemistry\'\'\):/gi, ""); txt = txt.replace(/\(\'\'chemistry\'\'\)/gi, ""); txt = txt.replace(/\(\'\'computing\'\'\):/gi, ""); txt = txt.replace(/\(\'\'computing\'\'\)/gi, "");

// of course, don't forget cricket txt = txt.replace(/\(\'\'cricket\'\'\):/gi, ""); txt = txt.replace(/\(\'\'cricket\'\'\)/gi, "");

txt = txt.replace(/\(\'\'curling\'\'\):/gi, ""); txt = txt.replace(/\(\'\'curling\'\'\)/gi, ""); txt = txt.replace(/\(\'\'geology\'\'\):/gi, ""); txt = txt.replace(/\(\'\'geology\'\'\)/gi, ""); txt = txt.replace(/\(\'\'geography\'\'\):/gi, ""); txt = txt.replace(/\(\'\'geography\'\'\)/gi, ""); txt = txt.replace(/\(\'\'geometry\'\'\):/gi, ""); txt = txt.replace(/\(\'\'geometry\'\'\)/gi, ""); txt = txt.replace(/\(\'\'grammar\'\'\):/gi, ""); txt = txt.replace(/\(\'\'grammar\'\'\)/gi, ""); txt = txt.replace(/\(\'\'heraldry\'\'\):/gi, ""); txt = txt.replace(/\(\'\'heraldry\'\'\)/gi, ""); txt = txt.replace(/\(\'\'internet\'\'\):/gi, ""); txt = txt.replace(/\(\'\'internet\'\'\)/gi, ""); txt = txt.replace(/\(\'\'law\'\'\):/gi, ""); txt = txt.replace(/\(\'\'law\'\'\)/gi, ""); txt = txt.replace(/\(\'\'lexicography\'\'\):/gi, ""); txt = txt.replace(/\(\'\'lexicography\'\'\)/gi, ""); txt = txt.replace(/\(\'\'linguistics\'\'\):/gi, ""); txt = txt.replace(/\(\'\'linguistics\'\'\)/gi, ""); txt = txt.replace(/\(\'\'logic\'\'\):/gi, ""); txt = txt.replace(/\(\'\'logic\'\'\)/gi, ""); txt = txt.replace(/\(\'\'mathematics\'\'\):/gi, ""); txt = txt.replace(/\(\'\'mathematics\'\'\)/gi, ""); txt = txt.replace(/\(\'\'math\'\'\):/gi, ""); txt = txt.replace(/\(\'\'math\'\'\)/gi, ""); txt = txt.replace(/\(\'\'maths\'\'\):/gi, ""); txt = txt.replace(/\(\'\'maths\'\'\)/gi, ""); txt = txt.replace(/\(\'\'mechanics\'\'\):/gi, ""); txt = txt.replace(/\(\'\'mechanics\'\'\)/gi, ""); txt = txt.replace(/\(\'\'medicine\'\'\):/gi, ""); txt = txt.replace(/\(\'\'medicine\'\'\)/gi, ""); txt = txt.replace(/\(\'\'military\'\'\):/gi, ""); txt = txt.replace(/\(\'\'military\'\'\)/gi, ""); txt = txt.replace(/\(\'\'mineralogy\'\'\):/gi, ""); txt = txt.replace(/\(\'\'mineralogy\'\'\)/gi, ""); txt = txt.replace(/\(\'\'music\'\'\):/gi, ""); txt = txt.replace(/\(\'\'music\'\'\)/gi, ""); txt = txt.replace(/\(\'\'mythology\'\'\):/gi, ""); txt = txt.replace(/\(\'\'mythology\'\'\)/gi, ""); txt = txt.replace(/\(\'\'nautical\'\'\):/gi, ""); txt = txt.replace(/\(\'\'nautical\'\'\)/gi, ""); txt = txt.replace(/\(\'\'physics\'\'\):/gi, ""); txt = txt.replace(/\(\'\'physics\'\'\)/gi, ""); txt = txt.replace(/\(\'\'physiology\'\'\):/gi, ""); txt = txt.replace(/\(\'\'physiology\'\'\)/gi, ""); txt = txt.replace(/\(\'\'sports\'\'\):/gi, ""); txt = txt.replace(/\(\'\'sports\'\'\)/gi, ""); txt = txt.replace(/\(\'\'theology\'\'\):/gi, ""); txt = txt.replace(/\(\'\'theology\'\'\)/gi, ""); txt = txt.replace(/\(\'\'zoology\'\'\):/gi, ""); txt = txt.replace(/\(\'\'zoology\'\'\)/gi, "");

//txt = txt.replace(/\(\'\'colour\'\'\):/gi, ""); //txt = txt.replace(/\(\'\'colour\'\'\)/gi, ""); //txt = txt.replace(/\(colour\):/gi, ""); //txt = txt.replace(/\(colour\)/gi, "");

txt = txt.replace(/\(\'\'historic\'\'\):/gi, ""); txt = txt.replace(/\(\'\'historic\'\'\)/gi, ""); txt = txt.replace(/\{\{historic\}\}:/gi, ""); txt = txt.replace(/\{\{historic\}\}/gi, ""); txt = txt.replace(/\(\'\'historical\'\'\):/gi, ""); txt = txt.replace(/\(\'\'historical\'\'\)/gi, ""); txt = txt.replace(/\(\'\'historically\'\'\):/gi, ""); txt = txt.replace(/\(\'\'historically\'\'\)/gi, "");

// gender and number templates txt = txt.replace(/m/g, ""); txt = txt.replace(/f/g, ""); txt = txt.replace(/n/g, ""); txt = txt.replace(/c/g, ""); txt = txt.replace(/p/g, ""); txt = txt.replace(/pl/g, ""); txt = txt.replace(/s/g, ""); txt = txt.replace(/m, f/g, ", "); txt = txt.replace(/m,f/g, ", "); txt = txt.replace(/m, n/g, ", "); txt = txt.replace(/m,n/g, ", "); txt = txt.replace(/f, n/g, ", "); txt = txt.replace(/f,n/g, ", "); txt = txt.replace(/m\/f/g, ", "); txt = txt.replace(/m\/n/g, ", "); txt = txt.replace(/f\/n/g, ", "); txt = txt.replace(/m s/g, " "); txt = txt.replace(/f s/g, " "); txt = txt.replace(/n s/g, " "); txt = txt.replace(/m pl/g, " "); txt = txt.replace(/f pl/g, " "); txt = txt.replace(/n pl/g, " "); txt = txt.replace(/m plural/g, " "); txt = txt.replace(/f plural/g, " "); //txt = txt.replace(/singular/g, "");

// no en:POS categories // before blank lines txt = txt.replace(/\[\[category:/gi, "[[Category:"); txt = txt.replace(/\[\[category: /gi, "[[Category:");

txt = txt.replace(/\[\[Category:English language\]\]\n/gi, ""); txt = txt.replace(/\[\[Category:English nouns\]\]\n/gi, ""); txt = txt.replace(/\[\[Category:English verbs\]\]\n/gi, ""); txt = txt.replace(/\[\[Category:English adjectives\]\]\n/gi, ""); txt = txt.replace(/\[\[Category:English adverbs\]\]\n/gi, ""); txt = txt.replace(/\[\[Category:English transitive verbs\]\]\n/gi, ""); txt = txt.replace(/\[\[Category:English intransitive verbs\]\]\n/gi, ""); txt = txt.replace(/\[\[Category:English countable nouns\]\]\n/gi, ""); txt = txt.replace(/\[\[Category:English abstract nouns\]\]\n/gi, ""); txt = txt.replace(/\[\[Category:English concrete nouns\]\]\n/gi, ""); txt = txt.replace(/\[\[Category:English collective nouns\]\]\n/gi, ""); txt = txt.replace(/\[\[Category:Countable\]\]\n/gi, ""); txt = txt.replace(/\[\[Category:Uncountable\]\]\n/gi, ""); txt = txt.replace(/\[\[Category:English proper nouns\]\]\n/gi, ""); txt = txt.replace(/\[\[Category:English slang\]\]\n/gi, "");

txt = txt.replace(/\}\n\[\[category:/gi, "}\n\n[[Category:");

// blank lines // always blank after inflection line txt = txt.replace(/\'\'\'\n#/g, "'''\n\n#"); txt = txt.replace(/\}\}\n#/g, "\}\}\n\n#"); // txt = txt.replace(/\'\'\'\)\n#/g, "'''\)\n\n#");

// undo bad change txt = txt.replace(/\'\'\'\n\n#:/g, "'''\n#:"); txt = txt.replace(/\}\}\n\n#:/g, "}}\n#:");

// always a blank immediately before level 3 or higher txt = txt.replace(/\n\=\=\=/g, "\n\n==="); txt = txt.replace(/\n\n\n\=\=\=/g, "\n\n===");

// no blank immediately after level 3 or higher txt = txt.replace(/\=\=\=\n\n/g, "===\n");

// multiple etyms txt = txt.replace(/\=\=\=\n\=\=\=\=/g, "===\n\n====");

// txt = txt.replace(/\=\n\n\'\'\'/g, "=\n'''");

// headers txt = txt.replace(/==quotations==/gi, "==Quotations=="); txt = txt.replace(/==quotation==/gi, "==Quotations=="); txt = txt.replace(/==quotes==/gi, "==Quotations=="); txt = txt.replace(/==quote==/gi, "==Quotations=="); txt = txt.replace(/==citations==/gi, "==Quotations=="); txt = txt.replace(/==citation==/gi, "==Quotations=="); txt = txt.replace(/==adjective==/gi, "==Adjective=="); txt = txt.replace(/==\[\[adjective\]\]==/gi, "==Adjective=="); txt = txt.replace(/==adverb==/gi, "==Adverb=="); txt = txt.replace(/==\[\[adverb\]\]==/gi, "==Adverb=="); txt = txt.replace(/==antonym==/gi, "==Antonyms=="); txt = txt.replace(/==\[\[antonym\]\]==/gi, "==Antonyms=="); txt = txt.replace(/==antonyms==/gi, "==Antonyms=="); txt = txt.replace(/==\[\[antonyms\]\]==/gi, "==Antonyms=="); txt = txt.replace(/==cardinal number==/gi, "==Cardinal number=="); txt = txt.replace(/==derived expression==/gi, "==Derived terms=="); txt = txt.replace(/==\[\[derived expression\]\]==/gi, "==Derived terms=="); txt = txt.replace(/==derived expressions==/gi, "==Derived terms=="); txt = txt.replace(/==\[\[derived expressions\]\]==/gi, "==Derived terms=="); txt = txt.replace(/==derived term==/gi, "==Derived terms=="); txt = txt.replace(/==\[\[derived term\]\]==/gi, "==Derived terms=="); txt = txt.replace(/==derived terms==/gi, "==Derived terms=="); txt = txt.replace(/==\[\[derived terms\]\]==/gi, "==Derived terms=="); txt = txt.replace(/==derived word==/gi, "==Derived terms=="); txt = txt.replace(/==\[\[derived word\]\]==/gi, "==Derived terms=="); txt = txt.replace(/==derived words==/gi, "==Derived terms=="); txt = txt.replace(/==\[\[derived words\]\]==/gi, "==Derived terms=="); txt = txt.replace(/==etymology==/gi, "==Etymology=="); txt = txt.replace(/==\[\[etymology\]\]==/gi, "==Etymology=="); txt = txt.replace(/==letter==\n/gi, "===Letter===\n"); txt = txt.replace(/==noun==/gi, "==Noun=="); txt = txt.replace(/==\[\[noun\]\]==/gi, "==Noun=="); txt = txt.replace(/==noun phrase==/gi, "==Noun=="); txt = txt.replace(/==\[\[noun phrase\]\]==/gi, "==Noun=="); txt = txt.replace(/==pronunciation==/gi, "==Pronunciation=="); txt = txt.replace(/==\[\[pronunciation\]\]==/gi, "==Pronunciation=="); txt = txt.replace(/==pronounciation==/gi, "==Pronunciation=="); txt = txt.replace(/==\[\[pronounciation\]\]==/gi, "==Pronunciation=="); txt = txt.replace(/==proper name==/gi, "==Proper noun=="); txt = txt.replace(/==\[\[proper name\]\]==/gi, "==Proper noun=="); txt = txt.replace(/==proper noun==/gi, "==Proper noun=="); txt = txt.replace(/==\[\[proper noun\]\]==/gi, "==Proper noun=="); txt = txt.replace(/==related term==/gi, "==Related terms=="); txt = txt.replace(/==\[\[related term\]\]==/gi, "==Related terms=="); txt = txt.replace(/==related terms==/gi, "==Related terms=="); txt = txt.replace(/==\[\[related terms\]\]==/gi, "==Related terms=="); txt = txt.replace(/==related word==/gi, "==Related terms=="); txt = txt.replace(/==\[\[related word\]\]==/gi, "==Related terms=="); txt = txt.replace(/==related words==/gi, "==Related terms=="); txt = txt.replace(/==\[\[related words\]\]==/gi, "==Related terms=="); txt = txt.replace(/==see also==/gi, "==See also=="); txt = txt.replace(/==\[\[see also\]\]==/gi, "==See also=="); txt = txt.replace(/==symbol==/gi, "==Symbol=="); txt = txt.replace(/==\[\[symbol\]\]==/gi, "==Symbol=="); txt = txt.replace(/==symbols==/gi, "==Symbol=="); txt = txt.replace(/==\[\[symbols\]\]==/gi, "==Symbol=="); txt = txt.replace(/==synonym==/gi, "==Synonyms=="); txt = txt.replace(/==\[\[synonym\]\]==/gi, "==Synonyms=="); txt = txt.replace(/==synonyms==/gi, "==Synonyms=="); txt = txt.replace(/==\[\[synonyms\]\]==/gi, "==Synonyms=="); txt = txt.replace(/==translation==/gi, "==Translations=="); txt = txt.replace(/==\[\[translation\]\]==/gi, "==Translations=="); txt = txt.replace(/==translations==/gi, "==Translations=="); txt = txt.replace(/==\[\[translations\]\]==/gi, "==Translations=="); txt = txt.replace(/==\[\[translation\]\]s==/gi, "==Translations=="); txt = txt.replace(/==note==/gi, "==Usage notes=="); txt = txt.replace(/==\[\[note\]\]==/gi, "==Usage notes=="); txt = txt.replace(/==notes==/gi, "==Usage notes=="); txt = txt.replace(/==\[\[notes\]\]==/gi, "==Usage notes=="); txt = txt.replace(/==\[\[usage note\]\]==/gi, "==Usage notes=="); txt = txt.replace(/==usage==/gi, "==Usage notes=="); txt = txt.replace(/==\[\[usage\]\]==/gi, "==Usage notes=="); txt = txt.replace(/==\[\[usage notes\]\]==/gi, "==Usage notes=="); txt = txt.replace(/==usages==/gi, "==Usage notes=="); txt = txt.replace(/==\[\[usages\]\]==/gi, "==Usage notes=="); txt = txt.replace(/==usage note==/gi, "==Usage notes=="); txt = txt.replace(/==verb==/gi, "==Verb=="); txt = txt.replace(/==\[\[verb\]\]==/gi, "==Verb=="); txt = txt.replace(/==forms and variants==/gi, "==Alternative spellings=="); txt = txt.replace(/==variant form==/gi, "==Alternative spellings=="); txt = txt.replace(/==variant forms==/gi, "==Alternative spellings=="); txt = txt.replace(/==alternate form==/gi, "==Alternative spellings=="); txt = txt.replace(/==alternate forms==/gi, "==Alternative spellings=="); txt = txt.replace(/==alternative form==/gi, "==Alternative spellings=="); txt = txt.replace(/==alternative forms==/gi, "==Alternative spellings=="); txt = txt.replace(/==alternate spelling==/gi, "==Alternative spellings=="); txt = txt.replace(/==alternate spellings==/gi, "==Alternative spellings=="); txt = txt.replace(/==alternative spelling==/gi, "==Alternative spellings=="); txt = txt.replace(/==other spellings==/gi, "==Alternative spellings=="); txt = txt.replace(/==spelling variant==/gi, "==Alternative spellings=="); txt = txt.replace(/==spelling variants==/gi, "==Alternative spellings=="); txt = txt.replace(/==spelling variation==/gi, "==Alternative spellings=="); txt = txt.replace(/==spelling variations==/gi, "==Alternative spellings=="); txt = txt.replace(/==spellings==/gi, "==Alternative spellings=="); txt = txt.replace(/==variant==/gi, "==Alternative spellings=="); txt = txt.replace(/==\[\[variant\]\]==/gi, "==Alternative spellings=="); txt = txt.replace(/==variant spelling==/gi, "==Alternative spellings=="); txt = txt.replace(/==variant spellings==/gi, "==Alternative spellings=="); txt = txt.replace(/==variants==/gi, "==Alternative spellings=="); txt = txt.replace(/==variation==/gi, "==Alternative spellings=="); txt = txt.replace(/==variations==/gi, "==Alternative spellings=="); txt = txt.replace(/==varieties==/gi, "==Alternative spellings=="); txt = txt.replace(/==typographic variants==/gi, "==Alternative spellings=="); txt = txt.replace(/==variant spelling==/gi, "==Alternative spellings=="); txt = txt.replace(/==variant spellings==/gi, "==Alternative spellings==");

txt = txt.replace(/==Quotations==\n/gi, "====Quotations====\n"); txt = txt.replace(/===Quotations===\n/gi, "====Quotations====\n"); txt = txt.replace(/==Adjective==\n/gi, "===Adjective===\n"); txt = txt.replace(/==Adverb==\n/gi, "===Adverb===\n"); txt = txt.replace(/==Derived terms==\n/gi, "====Derived terms====\n"); txt = txt.replace(/===Derived terms===\n/gi, "====Derived terms====\n"); txt = txt.replace(/==Etymology==\n/gi, "===Etymology===\n"); txt = txt.replace(/==Noun==\n/gi, "===Noun===\n"); txt = txt.replace(/==Pronunciation==\n/gi, "===Pronunciation===\n"); txt = txt.replace(/==See also==\n/gi, "===See also===\n"); txt = txt.replace(/====See also====\n/gi, "===See also===\n"); txt = txt.replace(/==Related terms==\n/gi, "====Related terms====\n"); txt = txt.replace(/==References==\n/gi, "===References===\n"); txt = txt.replace(/==Symbol==\n/gi, "===Symbol===\n"); txt = txt.replace(/==Antonyms==\n/gi, "====Antonyms====\n"); txt = txt.replace(/===Antonyms===\n/gi, "====Antonyms====\n"); txt = txt.replace(/==Synonyms==\n/gi, "====Synonyms====\n"); txt = txt.replace(/===Synonyms===\n/gi, "====Synonyms====\n"); txt = txt.replace(/==Translations==\n/gi, "====Translations====\n"); txt = txt.replace(/===Translations===\n/gi, "====Translations====\n"); txt = txt.replace(/==Usage notes==\n/gi, "====Usage notes====\n"); txt = txt.replace(/===Usage notes===\n/gi, "====Usage notes====\n"); txt = txt.replace(/==Verb==\n/gi, "===Verb===\n"); txt = txt.replace(/\#\*\ \[\[Synonym\]\]s\n/gi, "====Synonyms====\n"); txt = txt.replace(/\#\*\ Synonyms\n/gi, "====Synonyms====\n");

txt = txt.replace(/==Alternative spellings==\n/g, "===Alternative spellings===\n"); txt = txt.replace(/====Alternative spellings====\n/g, "===Alternative spellings===\n"); txt = txt.replace(/===Alternative spellings===\n\[/g, "===Alternative spellings===\n* [");

txt = txt.replace(/===transitive verb===\n/gi, "===Verb===\n "); txt = txt.replace(/====transitive verb====\n/gi, "====Verb====\n "); txt = txt.replace(/===intransitive verb===\n/gi, "===Verb===\n "); txt = txt.replace(/====intransitive verb====\n/gi, "====Verb====\n ");

txt = txt.replace(/====translations to be checked====\n/gi, "=====Translations to be checked=====\n"); txt = txt.replace(/====translations to be categorized====\n/gi, "=====Translations to be checked=====\n"); txt = txt.replace(/=====translations to be categorized=====\n/gi, "=====Translations to be checked=====\n"); txt = txt.replace(/======translations to be categorized======\n/gi, "======Translations to be checked======\n");

// automatic translation table txt = txt.replace(/Translations====\n\*/g, "Translations====\n\n\n\n\*"); txt = txt.replace(/Translations=====\n\*/g, "Translations=====\n\n\n\n\*");

// dewikification major languages txt = txt.replace(/\*\[\[Albanian\]\]:/gi, "*Albanian:"); txt = txt.replace(/\*\[\[Arabic\]\]:/gi, "*Arabic:"); txt = txt.replace(/\*\[\[Armenian\]\]:/gi, "*Armenian:"); txt = txt.replace(/\*\[\[Belarusian\]\]:/gi, "*Belarusian:"); txt = txt.replace(/\*\[\[Bosnian\]\]:/gi, "*Bosnian:"); txt = txt.replace(/\*\[\[Bulgarian\]\]:/gi, "*Bulgarian:"); txt = txt.replace(/\*\[\[Chinese\]\]:/gi, "*Chinese:"); txt = txt.replace(/\*\[\[Croatian\]\]:/gi, "*Croatian:"); txt = txt.replace(/\*\[\[Czech\]\]:/gi, "*Czech:"); txt = txt.replace(/\*\[\[Danish\]\]:/gi, "*Danish:"); txt = txt.replace(/\*\[\[Dutch\]\]:/gi, "*Dutch:"); txt = txt.replace(/\*\[\[Estonian\]\]:/gi, "*Estonian:"); txt = txt.replace(/\*\[\[Hungarian\]\]:/gi, "*Hungarian:"); txt = txt.replace(/\*Farsi:/gi, "*Persian:"); txt = txt.replace(/\*\[\[Farsi\]\]:/gi, "*Persian:"); txt = txt.replace(/\*\[\[Finnish\]\]:/gi, "*Finnish:"); txt = txt.replace(/\*\[\[French\]\]:/gi, "*French:"); txt = txt.replace(/\*\[\[German\]\]:/gi, "*German:"); txt = txt.replace(/\*\[\[Georgian\]\]:/gi, "*Georgian:"); txt = txt.replace(/\*\[\[Greek\]\]:/gi, "*Greek:"); txt = txt.replace(/\*\[\[Hebrew\]\]:/gi, "*Hebrew:"); txt = txt.replace(/\*\[\[Hungarian\]\]:/gi, "*Hungarian:"); txt = txt.replace(/\*\[\[Icelandic\]\]:/gi, "*Icelandic:"); txt = txt.replace(/\*\[\[Indonesian\]\]:/gi, "*Indonesian:"); txt = txt.replace(/\*\[\[Italian\]\]:/gi, "*Italian:"); txt = txt.replace(/\*\[\[Japanese\]\]:/gi, "*Japanese:"); txt = txt.replace(/\*\[\[Korean\]\]:/gi, "*Korean:"); txt = txt.replace(/\*\[\[Latin\]\]:/gi, "*Latin:"); txt = txt.replace(/\*\[\[Latvian\]\]:/gi, "*Latvian:"); txt = txt.replace(/\*\[\[Lithuanian\]\]:/gi, "*Lithuanian:"); txt = txt.replace(/\*\[\[Norwegian\]\]:/gi, "*Norwegian:"); txt = txt.replace(/\*\[\[Persian\]\]:/gi, "*Persian:"); txt = txt.replace(/\*\[\[Polish\]\]:/gi, "*Polish:"); txt = txt.replace(/\*\[\[Portuguese\]\]:/gi, "*Portuguese:"); txt = txt.replace(/\*\[\[Romanian\]\]:/gi, "*Romanian:"); txt = txt.replace(/\*\[\[Russian\]\]:/gi, "*Russian:"); txt = txt.replace(/\*\[\[Serbian\]\]:/gi, "*Serbian:"); txt = txt.replace(/\*\[\[Slovak\]\]:/gi, "*Slovak:");

// don't be a POV pusher for once txt = txt.replace(/\*\[\[Slovene\]\]:/gi, "*Slovene:"); txt = txt.replace(/\*\[\[Slovenian\]\]:/gi, "*Slovenian:");

txt = txt.replace(/\*\[\[Spanish\]\]:/gi, "*Spanish:"); txt = txt.replace(/\*\[\[Swedish\]\]:/gi, "*Swedish:"); txt = txt.replace(/\*\[\[Translingual\]\]:/gi, "*Translingual:"); txt = txt.replace(/\*\[\[Turkish\]\]:/gi, "*Turkish:"); txt = txt.replace(/\*\[\[Vietnamese\]\]:/gi, "*Vietnamese:");

// txt = txt.replace(/\# third-person/gi, "# third person"); txt = txt.replace(/\# plural of/gi, "# "); txt = txt.replace(/\# third person of/gi, "# "); txt = txt.replace(/\# third person singular of/gi, "# "); txt = txt.replace(/\# third person singular present of/gi, "# "); txt = txt.replace(/\# third person singular simple present of/gi, "# "); txt = txt.replace(/\# present participle of/gi, "# "); txt = txt.replace(/\# past tense of/gi, "# "); txt = txt.replace(/\# past and past participle of/gi, "# "); txt = txt.replace(/\# past tense and past participle of/gi, "# "); txt = txt.replace(/\# simple past and past participle of/gi, "# "); txt = txt.replace(/\# simple past tense and past participle of/gi, "# "); txt = txt.replace(/\# simple past of/gi, "# "); txt = txt.replace(/\# past participle of/gi, "# ");

// lowercasing txt = txt.replace(/\{\{Wikipedia\}\}/g, "");

// infl line between header and defs // keep below see also's txt = txt.replace(/\=\n#/gi, "=\n\n\n#");

// language templates txt = txt.replace(/\{\{af\}\}/g, ""); txt = txt.replace(/\{\{alb\}\}/g, ""); txt = txt.replace(/\{\{am\}\}/g, ""); txt = txt.replace(/\{\{an\}\}/g, ""); txt = txt.replace(/\{\{ang\}\}/g, ""); txt = txt.replace(/\{\{ar\}\}/g, ""); txt = txt.replace(/\{\{arm\}\}/g, ""); txt = txt.replace(/\{\{arn\}\}/g, ""); txt = txt.replace(/\{\{ast\}\}/g, ""); txt = txt.replace(/\{\{az\}\}/g, ""); txt = txt.replace(/\{\{be\}\}/g, ""); txt = txt.replace(/\{\{bg\}\}/g, ""); txt = txt.replace(/\{\{bh\}\}/g, ""); txt = txt.replace(/\{\{bns\}\}/g, ""); txt = txt.replace(/\{\{bos\}\}/g, ""); txt = txt.replace(/\{\{br\}\}/g, ""); txt = txt.replace(/\{\{bs\}\}/g, ""); txt = txt.replace(/\{\{ca\}\}/g, ""); txt = txt.replace(/\{\{ch\}\}/g, ""); txt = txt.replace(/\{\{chr\}\}/g, ""); txt = txt.replace(/\{\{cic\}\}/g, ""); txt = txt.replace(/\{\{cr\}\}/g, ""); txt = txt.replace(/\{\{cs\}\}/g, ""); txt = txt.replace(/\{\{cy\}\}/g, ""); txt = txt.replace(/\{\{da\}\}/g, ""); txt = txt.replace(/\{\{de\}\}/g, ""); txt = txt.replace(/\{\{el\}\}/g, ""); txt = txt.replace(/\{\{en\}\}/g, ""); txt = txt.replace(/\{\{eo\}\}/g, ""); txt = txt.replace(/\{\{es\}\}/g, ""); txt = txt.replace(/\{\{et\}\}/g, ""); txt = txt.replace(/\{\{eu\}\}/g, ""); txt = txt.replace(/\{\{fa\}\}/g, ""); txt = txt.replace(/\{\{fe\}\}/g, ""); txt = txt.replace(/\{\{fi\}\}/g, ""); txt = txt.replace(/\{\{fj\}\}/g, ""); txt = txt.replace(/\{\{fo\}\}/g, ""); txt = txt.replace(/\{\{fr\}\}/g, ""); txt = txt.replace(/\{\{fur\}\}/g, ""); txt = txt.replace(/\{\{fy\}\}/g, ""); txt = txt.replace(/\{\{ga\}\}/g, ""); txt = txt.replace(/\{\{gd\}\}/g, ""); txt = txt.replace(/\{\{gl\}\}/g, ""); txt = txt.replace(/\{\{gmh\}\}/g, ""); txt = txt.replace(/\{\{gn\}\}/g, ""); txt = txt.replace(/\{\{goh\}\}/g, ""); txt = txt.replace(/\{\{got\}\}/g, ""); txt = txt.replace(/\{\{gr\}\}/g, ""); txt = txt.replace(/\{\{grc\}\}/g, ""); txt = txt.replace(/\{\{gu\}\}/g, ""); txt = txt.replace(/\{\{gv\}\}/g, ""); txt = txt.replace(/\{\{haw\}\}/g, ""); txt = txt.replace(/\{\{he\}\}/g, ""); txt = txt.replace(/\{\{hi\}\}/g, ""); txt = txt.replace(/\{\{hr\}\}/g, ""); txt = txt.replace(/\{\{hu\}\}/g, ""); txt = txt.replace(/\{\{hy\}\}/g, ""); txt = txt.replace(/\{\{ia\}\}/g, ""); txt = txt.replace(/\{\{id\}\}/g, ""); txt = txt.replace(/\{\{io\}\}/g, ""); txt = txt.replace(/\{\{is\}\}/g, ""); txt = txt.replace(/\{\{it\}\}/g, ""); txt = txt.replace(/\{\{ja\}\}/g, ""); txt = txt.replace(/\{\{jp\}\}/g, ""); txt = txt.replace(/\{\{jv\}\}/g, ""); txt = txt.replace(/\{\{ka\}\}/g, ""); txt = txt.replace(/\{\{kk\}\}/g, ""); txt = txt.replace(/\{\{kky\}\}/g, ""); txt = txt.replace(/\{\{kld\}\}/g, ""); txt = txt.replace(/\{\{km\}\}/g, ""); txt = txt.replace(/\{\{kn\}\}/g, ""); txt = txt.replace(/\{\{ko\}\}/g, ""); txt = txt.replace(/\{\{kr\}\}/g, ""); txt = txt.replace(/\{\{ku\}\}/g, ""); txt = txt.replace(/\{\{kw\}\}/g, ""); txt = txt.replace(/\{\{la\}\}/g, ""); txt = txt.replace(/\{\{lb\}\}/g, ""); txt = txt.replace(/\{\{li\}\}/g, ""); txt = txt.replace(/\{\{lo\}\}/g, ""); txt = txt.replace(/\{\{lt\}\}/g, ""); txt = txt.replace(/\{\{lv\}\}/g, ""); txt = txt.replace(/\{\{ma\}\}/g, ""); txt = txt.replace(/\{\{mdf\}\}/g, ""); txt = txt.replace(/\{\{mh\}\}/g, ""); txt = txt.replace(/\{\{mi\}\}/g, ""); txt = txt.replace(/\{\{mk\}\}/g, ""); txt = txt.replace(/\{\{ml\}\}/g, ""); txt = txt.replace(/\{\{mn\}\}/g, ""); txt = txt.replace(/\{\{mr\}\}/g, ""); txt = txt.replace(/\{\{ms\}\}/g, ""); txt = txt.replace(/\{\{mt\}\}/g, ""); txt = txt.replace(/\{\{my\}\}/g, ""); txt = txt.replace(/\{\{nap\}\}/g, ""); txt = txt.replace(/\{\{ne\}\}/g, ""); txt = txt.replace(/\{\{nl\}\}/g, ""); txt = txt.replace(/\{\{nn\}\}/g, ""); txt = txt.replace(/\{\{no\}\}/g, ""); txt = txt.replace(/\{\{non\}\}/g, ""); txt = txt.replace(/\{\{oc\}\}/g, ""); txt = txt.replace(/\{\{pap\}\}/g, ""); txt = txt.replace(/\{\{pl\}\}/g, ""); txt = txt.replace(/\{\{pms\}\}/g, ""); txt = txt.replace(/\{\{pt\}\}/g, ""); txt = txt.replace(/\{\{rap\}\}/g, ""); txt = txt.replace(/\{\{ro\}\}/g, ""); txt = txt.replace(/\{\{ru\}\}/g, ""); txt = txt.replace(/\{\{sa\}\}/g, ""); txt = txt.replace(/\{\{scn\}\}/g, ""); txt = txt.replace(/\{\{sco\}\}/g, ""); txt = txt.replace(/\{\{se\}\}/g, ""); txt = txt.replace(/\{\{si\}\}/g, ""); txt = txt.replace(/\{\{sk\}\}/g, ""); txt = txt.replace(/\{\{sl\}\}/g, ""); txt = txt.replace(/\{\{sm\}\}/g, ""); txt = txt.replace(/\{\{sq\}\}/g, ""); txt = txt.replace(/\{\{sr\}\}/g, ""); txt = txt.replace(/\{\{su\}\}/g, ""); txt = txt.replace(/\{\{sv\}\}/g, ""); txt = txt.replace(/\{\{sw\}\}/g, ""); txt = txt.replace(/\{\{ta\}\}/g, ""); txt = txt.replace(/\{\{te\}\}/g, ""); txt = txt.replace(/\{\{th\}\}/g, ""); txt = txt.replace(/\{\{tl\}\}/g, ""); txt = txt.replace(/\{\{tlh\}\}/g, ""); txt = txt.replace(/\{\{tm\}\}/g, ""); txt = txt.replace(/\{\{tr\}\}/g, ""); txt = txt.replace(/\{\{tt\}\}/g, ""); txt = txt.replace(/\{\{tyv\}\}/g, ""); txt = txt.replace(/\{\{ua\}\}/g, ""); txt = txt.replace(/\{\{uk\}\}/g, ""); txt = txt.replace(/\{\{ur\}\}/g, ""); txt = txt.replace(/\{\{uz\}\}/g, ""); txt = txt.replace(/\{\{vec\}\}/g, ""); txt = txt.replace(/\{\{vi\}\}/g, ""); txt = txt.replace(/\{\{vo\}\}/g, ""); txt = txt.replace(/\{\{wa\}\}/g, ""); txt = txt.replace(/\{\{wen\}\}/g, ""); txt = txt.replace(/\{\{xh\}\}/g, ""); txt = txt.replace(/\{\{yi\}\}/g, ""); txt = txt.replace(/\{\{yo\}\}/g, ""); txt = txt.replace(/\{\{zh\}\}/g, ""); txt = txt.replace(/\{\{zu\}\}/g, "");

// pronunciations // first position txt = txt.replace(/\[\[w:SAMPA\|SAMPA\]\]: \/\(.*)\<\/tt\>\//g, ""); txt = txt.replace(/SAMPA: \/\(.*)\<\/tt\>\//g, ""); txt = txt.replace(/SAMPA:\/\(.*)\<\/tt\>\//g, ""); txt = txt.replace(/\/\(.*)\<\/tt\>\//g, "");

txt = txt.replace(/\[\[w:AHD\|AHD\]\] (.*)/g, ""); txt = txt.replace(/\[\[w:AHD\|AHD\]\] \/(.*)\//g, ""); txt = txt.replace(/\[\[w:IPA\|IPA\]\] \/(.*)\//g, ""); txt = txt.replace(/\[\[w:SAMPA\|SAMPA\]\] \/(.*)\//g, ""); txt = txt.replace(/\[\[w:AHD\|AHD\]\]: (.*)/g, ""); txt = txt.replace(/\[\[w:AHD\|AHD\]\]: \/(.*)\//g, ""); txt = txt.replace(/\[\[w:IPA\|IPA\]\]: \/(.*)\//g, ""); txt = txt.replace(/\[\[w:SAMPA\|SAMPA\]\]: \/(.*)\//g, ""); txt = txt.replace(/\[\[w:AHD\|AHD\]\]:(.*)/g, ""); txt = txt.replace(/\[\[w:AHD\|AHD\]\]:\/(.*)\//g, ""); txt = txt.replace(/\[\[w:IPA\|IPA\]\]:\/(.*)\//g, ""); txt = txt.replace(/\[\[w:SAMPA\|SAMPA\]\]:\/(.*)\//g, ""); txt = txt.replace(/\[\[AHD\]\] (.*)/g, ""); txt = txt.replace(/\[\[AHD\]\] \/(.*)\//g, ""); txt = txt.replace(/\[\[IPA\]\] \/(.*)\//g, ""); txt = txt.replace(/\[\[SAMPA\]\] \/(.*)\//g, ""); txt = txt.replace(/\[\[AHD\]\]: (.*)/g, ""); txt = txt.replace(/\[\[AHD\]\]: \/(.*)\//g, ""); txt = txt.replace(/\[\[IPA\]\]: \/(.*)\//g, ""); txt = txt.replace(/\[\[SAMPA\]\]: \/(.*)\//g, ""); txt = txt.replace(/\[\[AHD\]\]:(.*)/g, ""); txt = txt.replace(/\[\[AHD\]\]:\/(.*)\//g, ""); txt = txt.replace(/\[\[IPA\]\]:\/(.*)\//g, ""); txt = txt.replace(/\[\[SAMPA\]\]:\/(.*)\//g, ""); txt = txt.replace(/AHD: (.*)/g, ""); txt = txt.replace(/AHD: \/(.*)\//g, ""); txt = txt.replace(/IPA: \/(.*)\//g, ""); txt = txt.replace(/SAMPA: \/(.*)\//g, ""); txt = txt.replace(/AHD:(.*)/g, ""); txt = txt.replace(/AHD:\/(.*)\//g, ""); txt = txt.replace(/IPA:\/(.*)\//g, ""); txt = txt.replace(/SAMPA:\/(.*)\//g, "");

// always last position ! txt = txt.replace(/\=\n\{\{IPA\|/g, "=\n\*{{IPA|"); txt = txt.replace(/\=\n\{\{SAMPA\|/g, "=\n\*{{SAMPA|"); txt = txt.replace(/\=\n\{\{AHD\|/g, "=\n\*{{AHD|");

// hr txt = txt.replace(/\n\=\=/g, "\n\n==");

// text txt = txt.replace(/Plural:/gi, "plural"); // Serbian: Latin -> Roman txt = txt.replace(/\*:Latin:/gi, "*:Roman:");

// no multiple blank lines txt = txt.replace(/\n\n\n/g, "\n\n"); txt = txt.replace(/\n\n\n\n/g, "\n\n"); txt = txt.replace(/\n\n\n\n\n/g, "\n\n"); txt = txt.replace(/\n\n\n\n\n\n/g, "\n\n"); txt = txt.replace(/\n\n\n\n\n\n\n/g, "\n\n"); txt = txt.replace(/\n\n\n\n\n\n\n\n/g, "\n\n"); txt = txt.replace(/\n\n\n\n\n\n\n\n\n/g, "\n\n");

}

function autoFormat { pagetitle = document.getElementById('content').getElementsByTagName('h1').item(0).firstChild.nodeValue; if (pagetitle.search(/Editing /) == -1) return; pagetitle = pagetitle.replace(/Editing /g, ""); pageexternal = pagetitle.replace(/\ /g, "_");

if (pagetitle.search(/\:/) != -1) { return; }

txt = " " + document.editform.wpTextbox1.value; txt = txt.substr (1, txt.length-1); myoldtxt = txt; oldtxt = txt; if (txt.length < 2) txt = " " + txt;

textReplace;

if (txt==" ") txt = ""; document.editform.wpTextbox1.value = txt;

oldtxt = myoldtxt; if (txt != oldtxt) { if (document.editform.wpSummary.value == "") document.editform.wpDiff.click; } }

function reformatMyPage { autoFormat; }

window.myAddOnload=function(f) { if (window.addEventListener) window.addEventListener("load", f, false); else if (window.attachEvent) window.attachEvent("onload",f); }

myAddOnload(reformatMyPage);

//