Content deleted Content added
Ohconfucius (talk | contribs) No edit summary |
Ohconfucius (talk | contribs) mirror bug-fix in test script |
||
Line 73:
// removing artefacts within fields
regex(/(\|\s?author\s*\=\s*)(?:by |)(?:[^|]+staff|(?:staff |)(?:reporter|writer)s?|)[
regex(/(\|\s?author\s*\=\s*)([A-Z][a-z]*(?: [A-Z][a-z]*)*) (?:(?:wire |)staff|(?:staff |)(?:reporter|writer)s?)[
regex(/\|[ ]*last=(Reporter|staff)[ ]*\|[ ]*first=[^|\{\}]*(?=[\|{}])
regex(/\|[ ]*(?:first|last)=(?:staff |)(?:reporter|writer)[ ]*(?=[\|{}])
regex(/\|[ ]*first= ?staff ?\|[ ]*last=(?:reporter|writer)[ ]*(?=[\|{}])/gi, '');
regex(/\|[ ]*first= ?The ?\|[ ]*last=[^\|{}]*(?=[\|{}])/gi, '');
regex(/(\|\s?access-?date\s*\=\s*)(?:accessed|retrieved)(?: by| on|):?[ ]*(\d)/gi, '$1$2');
regex(/(\|\s?access-?date\s*\=\s*\d{4}\s?)(?=[|}])/gi, '');
regex(/(\|\s?work\s*\=\s*)(?:article|interview|review) ?(?=[|}
regex(/(\|\s?volume\s*\=\s*)vol(?:ume|\.?)[ ]*(\d)/gi, '$1$2');
regex(/(\|\s?pages?\s*\=\s*)(?:pages?|p[gp]?\.?)[ ]*(\d)/gi, '$1$2');
regex(/ [-–] (?:每日明報 daily news|東方日報)/gi, '');
regex(/ \.\.\. \{\{!\}\} 立場報道/gi, '');
regex(/(\|\s?title\s*\=\s*)Login ?(?=[|} regex(/(\|\s?)(?:publisher|website|work)=You ?tube(?:\.com|)(?=\s*[|}])/gi, '$1via=YouTube');
regex(/(\|\s?)(?:publisher|website|work)=(Amazon)(?:\.com|)(?:\.\w{2}|)(?=\s*[|}])/gi, '$1via=$2');
Line 95 ⟶ 98:
regex(/(\|\s?(?:authors?|first\d?|last\d?|publisher|work)\s*\=\s*(?:[^{}|]*|)){{(?:Sm|Aut|SC|Small[- ]caps|Sm?caps)\|([^{}|]*)}}(?=(?:[^{}|]*|)[|}])/gi, '$1');
regex(/(\|\s?)\w+\=(url\s*\=\s*https?:\/\/)(?=[|}
regex(/(\|\s?url\s*\=)(www\.)(?=[|}
regex(/(\|\s*date\s*=\s*)(?:not? |non-|un)date[ds]?\s*(?=[|}
regex(/(\|\s?dead-?url=no?)(?=\s*[|}])/gi, ''); //common cs1 error (deprecated parameter)
Line 173 ⟶ 176:
//'work' and its alias (pre)
regex(/(\|[ ]*?newspaper[ ]*=[^\|}]*(?:\|[^\{\}]*|))(?:\|[ ]*?work[ ]*=[^|}]*)(?=[|}
//rem linking within '___location' field
|