Content deleted Content added
Ohconfucius (talk | contribs) reinstate existing label |
Ohconfucius (talk | contribs) align to test script |
||
Line 35:
// removing references to other WP articles and 'external' WP links
txt.value=txt.value.replace(/<ref>https?:\/\/(?:en\.wikipedia\.org\/wiki|www\.(?:facebook|myspace|twitter)\.com)\/[^\s\]<]*<\/ref>/gi, '');
regex(/\|[ ]*url[ ]*=[ ]*https?:\/\/(?:\w{2}\.wikipedia\.org\/wiki|www\.(?:facebook|myspace|twitter)\.com)[^\s\|\{\}<]*(?=[ ]*[\|\}])/gi, '');
// removing external links within publisher/journal/work fields
Line 93 ⟶ 94:
//rem duplicated publishers in separate fields (pre)
//'work' and its alias (pre)
regex(/(\|[ ]*?newspaper[ ]*=[^\|]*(?:\|[^\{\}]*|))(?:\|[ ]*?work[ ]*=[^\|\}]*)(?=[\|\}])+/gi, '$1');
//rem linking within locations field
regex(/(\|[ ]*?___location=[ ]*?)\[\[([^\|\]]+?)\]\](?:(,? )\[\[([^\|\]]+?)\]\]|)([ ]{0,1})/gi, '$1$2$3$4$5');
Line 102 ⟶ 106:
regex(/[ ]?\{\{en[- ]icon\}\}/gi, "");
// removing icon template from within "|language=" parameter
regex(/(\|[ ]*?language[ ]*?=[ ]*?)\{\{(\w{2})[- ]icon\}\}/gi, "$1$2");
// eliminating time of day
ohc_regex(/(\|[ ]*author[ ]*=[ ]*)(?:posted|published)(?: by| on|)[\s:](?=\s*\w)/gi, "$1");
Line 172 ⟶ 179:
txt.value=txt.value.replace(/(?:\|\s?(newspaper|work|publisher)\s*\=\s*\[\[(John Fairfax (and Sons Ltd\.?|Holdings)|Fairfax(?: Media(?: Limited|)| Digital| newspapers))\]\])(?=[\s\.]*[\|\}])/gi, '');
txt.value=txt.value.replace(/(?:\|\s?publisher\s*\=\s*(Alexander Lebedev|American Media|Associated Newspapers|Cond[eé] Nast(?: Publications|)|Daily Mail and General Trust|Devin Laz[ae]rine|(Guardian|Telegraph) Media Group|(?:Guardian|Independent) News (?:and|&) Media|Hachette Filipacchi Médias|Hearst (?:Corporation|Magazines(?: UK|))|Herald Media|Imdb Inc\.?|InterMedia Partners|IDG|IPC Media|Lee Enterprises|Media ?News Group|Mortimer Zuckerman|MTV Networks|News (?:Corporation|International|Limited)|Prometheus Global Media|Reed Business Information|Rovi Corporation|Trinity Mirror|Times Newspapers|Nielsen (?: Media Research|Business Media)|Viacom|Time(?: Warner ?|)))(,? Inc| LL[CP]| Ltd|Limited|)[\s\.]*(?=[\|\}])/gi, '');
regex(/\|\s?publisher\s*\=\s*(?:The |)(?:Deseret News Publishing|Dispatch Printing|E. W. Scripps|Evening Post Publishing|Forbes Publishing|Gannett?|(?:Jann Wenner|Wenner Media)|Johnson Publishing|Journal Communications|McClatchy|New York Times|Seattle Times|Star Tribune|Thomp?son(?:[- ]?Reuters)?(?: Corporation| Plc.?|)|Torstar|Times (?:Group|Publishing)|Tribune|Washington Post|World Publishing)(?: Co(?:mpany|\.)?)?(?=[\s\.]*[\|\}])/g, '');
regex(/\|\s?publisher\s*\=\s*(?:Cox|Halifax|North Jersey|Sun-Times|Tampa|Herald|Stephens|WEHCO) Media( Group(?:, Inc.)?)?(?=[\s\.]*[\|\}])/g, '');
//duplicate above with links
txt.value=txt.value.replace(/(?:\|\s?publisher\s*\=\s*\[\[(Alexander Lebedev|American Media|Associated Newspapers|Cond[eé] Nast(?: Publications|)|Daily Mail and General Trust|Devin Laz[ae]rine|(Guardian|Telegraph) Media Group|(?:Guardian|Independent) News (?:and|&) Media|Hachette Filipacchi Médias|Hearst (?:Corporation|Magazines(?: UK|))|Herald Media|Imdb Inc\.?|InterMedia Partners|IDG|IPC Media|Lee Enterprises|Media ?News Group|Mortimer Zuckerman|MTV Networks|News (?:Corporation|International|Limited)|Prometheus Global Media|Reed Business Information|Rovi Corporation|Trinity Mirror|Times Newspapers|Nielsen (?: Media Research|Business Media)|Viacom|Time(?: Warner ?|)))(,? Inc| LL[CP]| Ltd|Limited|)(?:\|[^\]\}]*|)\]\][\s\.]*(?=[\|\}])/gi, '');
regex(/\|\s?publisher\s*\=\s*\[\[(?:The |)(?:Deseret News Publishing|Dispatch Printing|E. W. Scripps|Evening Post Publishing|Forbes Publishing|Gannett?|(?:Jann Wenner|Wenner Media)|Johnson Publishing|Journal Communications|McClatchy|New York Times|Seattle Times|Star Tribune|Thomp?son(?:[- ]?Reuters)?(?: Corporation| Plc.?|)|Torstar|Times (?:Group|Publishing)|Tribune|Washington Post|World Publishing)(?: Co(?:mpany|\.)?)?\]\](?=[\s\.]*[\|\}])/g, '');
regex(/\|\s?publisher\s*\=\s*\[\[(?:Cox|Halifax|North Jersey|Sun-Times|Tampa|Herald|Stephens|WEHCO) Media( Group(?:, Inc.)?)?\]\](?=[\s\.]*[\|\}])/g, '');
Line 202 ⟶ 209:
regex(/(=[ ]*)(Billboard|Fast Company|Q|Time Out) \((?:magazine)\)(?=\s*[\|\}])/g, '$1$2'); //non-standard code
regex(/('')(Billboard|Fast Company|Q|Time Out) \(magazine\)(?='')/g, '$1$2'); //non-standard code
regex(/(\[\[)(Billboard|Fast Company|Q|Time Out)( \(magazine\))(?=\]\])/g, '$1$2$3|$2'); ▼
regex(/(\|)(Billboard|Fast Company|Q|Time Out)(?: \(magazine\))(?=\]\])/g, '$1$2');
regex(/(=[ ]*Daily News) \((New York)\)([ ]*[\|\}])/g, '$1|___location=$2$3');
regex(/(''Daily News) \((New York)\)('')/g, '$1$3 \($2\)');
regex(/(\[\[)(Daily News)( \(New York\))(\]\][\.,;]?)/g, '$1$2$3|$2$4');▼
regex(/(\|)(Daily News)(?: \(New York\))(\]\])/g, '$1$2$3');
regex(/(=[ ]*Daily Record|=[ ]*Sunday Mail) \((Scotland)\)(\s*[\|\}])/g, '$1|___location=$2$3');
regex(/(''Daily Record|''Sunday Mail) \((Scotland)\)('')/g, '$1$3 \($2\)');
regex(/(\|)(Daily Record|Sunday Mail)(?: \(Scotland\))(\]\])/g, '$1$2$3');
regex(/(=[ ]*Dawn) \((newspaper)\)(\s*[\|\}])/g, '$1|___location=Pakistan$3');
regex(/(''Dawn) \((newspaper)\)('')/g, '$1$3 \(Pakistan\)');
regex(/(\[\[)(Dawn)( \(newspaper\))(\]\])/g, '$1$2$3|$2$4');▼
regex(/(\|)(Dawn)(?: \(newspaper\))(\]\])/g, '$1$2$3');
regex(/(=[ ]*(?:Daily Star)) \((United Kingdom)\)(\s*[\|\}])/g, '$1|___location=$2$3');
regex(/(''(?:Daily Star)) \((United Kingdom)\)('')/g, '$1$3 \($2\)');
regex(/(\|)(Daily Star)(?: \(United Kingdom\))(\]\])/g, '$1$2$3');
regex(/(=[ ]*El Mundo) \((Columbia|Spain)\)(\s*[\|\}])/g, '$1|___location=$2$3');
regex(/(''El Mundo) \((Columbia|Spain)\)('')/g, '$1$3 \($2\)');
regex(/(\|)(El Mundo)(?: \((?:Columbia|Spain)\))(\]\])/g, '$1$2$3');
regex(/(=[ ]*The Daily Star) \((Lebanon)\)(\s*[\|\}])/g, '$1|___location=$2$3');
regex(/(''The Daily Star) \((Lebanon)\)('')/g, '$1$3 \($2\)');
regex(/(\|)(The Daily Star)(?: \(Lebanon\))(\]\])/g, '$1$2$3');
regex(/(=[ ]*The Gazette) \((Montreal)\)(\s*[\|\}])/g, '$1|___location=$2$3');
regex(/(''The Gazette) \((Montreal)\)('')/g, '$1$3 \($2\)');
regex(/(\|)(The Gazette)(?: \(Montreal\))(\]\])/g, '$1$2$3');
regex(/(=[ ]*The Herald) \((Glasgow)\)(\s*[\|\}])/g, '$1|___location=$2$3');
regex(/(''The Herald) \((Glasgow)\)('')/g, '$1$3 \($2\)');
regex(/(\|)(The Herald)(?: \(Glasgow\))(\]\])/g, '$1$2$3');
▲ regex(/(
▲ regex(/(\
regex(/(=[ ]*The Nation) \((Malawi|Nigeria|Pakistan|Thailand)\)(\s*[\|\}])/g, '$1|___location=$2$3');
regex(/(''The Nation) \((Malawi|Nigeria|Pakistan|Thailand)\)('')/g, '$1$3 \($2\)');
regex(/(\|)(The Nation)(?: \((?:Malawi|Nigeria|Pakistan|Thailand)\))(\]\])/g, '$1$2$3');
regex(/(=[ ]*The National) \((Abu Dhabi)\)(\s*[\|\}])/g, '$1|___location=$2$3');
regex(/(''The National) \((Abu Dhabi)\)('')/g, '$1$3 \($2\)');
regex(/(\|)(The National)(?: \(Abu Dhabi\))(\]\])/g, '$1$2$3');
regex(/(=[ ]*La Presse) \((Canadian newspaper)\)(\s*[\|\}])/g, '$1|___location=Canada$3');
regex(/(''La Presse) \((Canadian newspaper)\)('')/g, '$1$3 \(Canada\)');
regex(/(\|)(La Presse)(?: \(Canadian newspaper\))(\]\])/g, '$1$2$3');
regex(/(=[ ]*Les Échos) \((France)\)(\s*[\|\}])/g, '$1|___location=$2$3');
regex(/(''Les Échos) \((France)\)('')/g, '$1$3 \($2\)');
regex(/(\|)(Les Échos)(?: \(France\))(\]\])/g, '$1$2$3');
regex(/(=[ ]*Panorama) \((Gibraltar)\)(\s*[\|\}])/g, '$1|___location=$2$3');
regex(/(''Panorama) \((Gibraltar)\)('')/g, '$1$3 \($2\)');
regex(/(\|)(Panorama)(?: \(Gibraltar\))(\]\])/g, '$1$2$3');
regex(/(=[ ]*The Pioneer) \((Indian newspaper)\)(\s*[\|\}])/g, '$1|___location=India$3');
regex(/(''The Pioneer) \((Indian newspaper)\)('')/g, '$1$3 \(India\)');
regex(/(\|)(The Pioneer)(?: \(Indian newspaper\))(\]\])/g, '$1$2$3');
regex(/(=[ ]*Sporting Life) \((British newspaper)\)(\s*[\|\}])/g, '$1|___location=UK$3');
regex(/(''Sporting Life) \((British newspaper)\)('')/g, '$1$3 \(UK\)');
regex(/(\|)(Sporting Life)(?: \(British newspaper\))(\]\])/g, '$1$2$3');
regex(/(=[ ]*The Standard) \((Hong Kong|Kenya)\)(\s*[\|\}])/g, '$1|___location=$2$3');
regex(/(''The Standard) \((Hong Kong|Kenya)\)('')/g, '$1$3 \($2\)');
regex(/(\|)(The Standard)(?: \((?:Hong Kong|Kenya)\))(\]\])/g, '$1$2$3');
regex(/(=[ ]*The Star) \((Malaysia)\)(\s*[\|\}])/g, '$1|___location=$2$3');
regex(/(''The Star) \((Malaysia)\)('')/g, '$1$3 \($2\)');
regex(/(\|)(The Star)(?: \(Malaysia\))(\]\])/g, '$1$2$3');
regex(/(=[ ]*The Sun) \((Hong Kong|Malaysia|Nigeria|United Kingdom)\)(\s*[\|\}])/g, '$1|___location=$2$3');
regex(/(''The Sun) \((Hong Kong|Malaysia|Nigeria|United Kingdom)\)('')/g, '$1$3 \($2\)');
regex(/(\|)(The Sun)(?: \((?:Hong Kong|Malaysia|Nigeria|United Kingdom)\))(\]\])/g, '$1$2$3');
regex(/(=[ ]*The Telegraph) \(Calcutta\)(?=\s*[\|\}])/g, '$1|___location=Kolkota');
regex(/(''The Telegraph) \((Calcutta)\)('')/g, '$1$3 \(Calcutta\)');
regex(/(\|)(The Telegraph)(?: \(Calcutta\))(\]\])/g, '$1$2$3');
regex(/(=[ ]*(?:The Times)) \((Malta)\)(\s*[\|\}])/g, '$1|___location=$2$3');
regex(/(''(?:The Times)) \((Malta)\)('')/g, '$1$3 \($2\)');
regex(/(\|)(The Times)(?: \(Malta\))(\]\])/g, '$1$2$3');
regex(/(=[ ]*Vogue) \((British magazine)\)(\s*[\|\}])/g, '$1|___location=UK$3');
regex(/(''Vogue) \((British magazine)\)('')/g, '$1$3 \(UK\)');
regex(/(\|)(Vogue)(?: \(British magazine\))(\]\])/g, '$1$2$3');
regex(/(= ?(?:ABC|Marca)) \((newspaper)\)([ ]*[\|\}])/g, '$1|___location=Spain$3');
regex(/(''(?:ABC|Marca)) \((newspaper)\)('')/g, '$1$3 \(Spain\)');
regex(/(\|)(ABC|Marca)(?: \(newspaper\))(\]\])/g, '$1$2$3');
regex(/(= ?(?:Il Giorno)) \((newspaper)\)([ ]*[\|\}])/g, '$1|___location=Italy$3');
regex(/(''(?:Il Giorno)) \((newspaper)\)('')/g, '$1$3 \(Italy\)');
regex(/(\|)(Il Giorno)(?: \(newspaper\))(\]\])/g, '$1$2$3');
regex(/(= ?(?:RT)) \((TV network)\)([ ]*[\|\}])/g, '$1|___location=Russia$3');
// regex(/(RT) \((TV network)\)[\.,]/g, '$1$2 \(Russia\)');
regex(/(\|)(RT)(?: \(TV network\))(\]\])/g, '$1$2$3');
regex(/
// regex(/(=(?:Business Day|City Press|Daily News|Daily Voice|Independent Online|New Age|Post|Table Talk|The Citizen|The Mercury|The New Age|The Star|The Sunday Independent|The Sunday Times|The Times|The Witness|The World)) \((South Africa)(?:n newspaper|)\)([ ]*[\|\}])/g, '$1|___location=$2$3');
Line 312 ⟶ 297:
// removing redundancies
regex(/ – (?:Times of India|Rediff.com [\w]*)(?=[ ]?\|)/gi, '');
regex(/(?: +[‒–—―] *Times Of India|)(\]. +''The Times of India''\.)indiatimes\.com/gi, '$1');
regex(/(\w''\.)indiatimes\.com/gi, '$1');
regex(/\|[ ]?language[ ]?\=[ ]?English[ ]*?(?=[\|\}])/gi, ''); //note: adjusted for false positive in infoboxes books
regex(/- [\w]*\.com[ ]*\|/gi, '|');
Line 367 ⟶ 354:
//dynamic columns for reflists; remove scroll bar
regex(/(={2,4}[\n\r])[\r\n\s]*<div (?:style|class)=
regex(/(?:\{\{[Rr]eflist\}\}|<[Rr]eferences ?\/>)/g, '{{reflist|colwidth=30em}}');
Line 484 ⟶ 471:
Ohc_linkspam();
ohc_unprotect_linkspam();
setreason('rem per [[WP:ELNO]] and [[WP:Linkspam
}
|