Content deleted Content added
Ohconfucius (talk | contribs) replace up to but not including function Ohc_sourceunlink |
Ohconfucius (talk | contribs) paste to end |
||
Line 581:
regex(/((?:[\[=]\s*)(?:https?:|ftp:))([^\]\|\}]*)(\s*[\]|}])/gi, protect_function);
regex(/((?:Category|Image|File):)([^|\]]*)([|\]])/gi, protect_function); //protect file names from being changed
regex(/(\{\{(?:FAA-airport|harv\w*|sfn\w*|cite ?book|listen)\s?\|)([^\}]+)(\}\})/gi, protect_function);
regex(/(\|\s*(?:contribution|quote|title)\s*=)([^|}]+)([\|\}])/gi, protect_function);
//whitelisting -against changes made by generic regex in Ohc_sourcepub (e.g. Fast Company)
Line 647:
// removing references to other WP articles and 'external' WP links
regex(/<ref[^<>]*>[^<>]*\|[ ]*url ?= ?https?:\/\/(?:\w{2}\.wikipedia\.org\/wiki|(?:www\.|)(?:blogger|blogspot|facebook|
regex(/<ref>https?:\/\/(?:en\.wikipedia\.org\/wiki|(?:www\.|)(?:blogger|blogspot|facebook|
regex(/<ref>\[https?:\/\/(?:en\.wikipedia\.org\/wiki|(?:www\.|)(?:blogger|blogspot|facebook|
regex(/\|[ ]*url[ ]*=[ ]*https?:\/\/(?:\w{2}\.wikipedia\.org\/wiki|(?:www\.|)(?:blogger|blogspot|facebook|
Line 659:
function ohc_ref_names() {
// give names to citations in templates that are without names
regex(/<ref>((?:[
regex(/<ref>((?:[^<>]*\|\s*url\s*=|[\[\s]?)https?:\/\/(?:[^|</]+\.)*(
regex(/<ref>((?:[^<>]*\|\s*url\s*=|[\[\s]?)https?:\/\/(?:[^|</]+\.)*([-\w]+)(?:\.[a-z]{2})\/[^<>|{}\d]*(\d{6,12})[^<>]*)(?=<\/ref>)/gi, "<ref name=$2_$3>$1"); //urls with non-date serial numbers
regex(/<ref>((?:[^<>]*\|\s*url\s*=|[\[\s]?)https?:\/\/(?:[^|</]+\.)*(reuters)\.com\/[^<>|{}\d]*(id\w{11})[^<>]*)(?=<\/ref>)/gi, "<ref name=$2_$3>$1"); //reuters urls with non-date serial numbers
ohc_regex(/<ref>((?:[^<>]*\|\s*url\s*=|[\[\s]?)https?:\/\/(?:[^|</]+\.)*([-\w]+)(?:\.[a-z]{2,3})\/[^<>|{}\d]*@YYYY[-\/]@MM[-\/]@DD\/(\w+)[^<>]*)(?=<\/ref>)/gi, "<ref name=$2_@Year@ZM@
ohc_regex(/<ref>((?:[^<>]*\|\s*url\s*=|[\[\s]?)https?:\/\/(?:[^|</]+\.)*([-\w]+)(?:\.[a-z]{2,3})\/[^<>|{}\d]*@YYYY[-\/]@
ohc_regex(/<ref>([^<>]*\|\s*url\s*=https?:\/\/(?:[^|</]+\.)*(\w+)\.(?:(?:com?|org|net|gov|ac|)(?:\.[a-z]{2}|))\/[^<>]*\|\s*date\s*=\s*@Day @Month @YYYY\s*[|}][^<>]*)(?=<\/ref>)/gi, "<ref name=$2_@Year@ZM@ZD
ohc_regex(/<ref>([^<>]*\|\s*url\s*=https?:\/\/(?:[^|</]+\.)*(\w+)\.(?:(?:com?|org|net|gov|ac|)(?:\.[a-z]{2}|))\/[^<>]*\|\s*date\s*=\s*@Month @Day, @YYYY\s*[|}][^<>]*)(?=<\/ref>)/gi, "<ref name=$2_@Year@ZM@ZD
ohc_regex(/<ref>([^<>]*\|\s*url\s*=https?:\/\/(?:[^|</]+\.)*(\w+)\.(?:(?:com?|org|net|gov|ac|)(?:\.[a-z]{2}|))\/[^<>]*\|\s*date\s*=\s*=\s*@YYYY-@MM-@DD\s*[|}][^<>]*)(?=<\/ref>)/gi, "<ref name=$2_@Year@
ohc_regex(/<ref>((?:[^<>]*\|\s*url\s*=|\[?)https?:\/\/(?:[^|<]+\.)*(\w+)\.(?:(?:com?|org|net|gov|ac|[a-z]{2})(?:\.[a-z]{2}|))\/[^<>|{}]+@YYYY[\/-]?@Month[\/-]?@Day[^<>]*)(?=<\/ref>)/gi, "<ref name=$2_@
}
|