User:Ohconfucius/test/Sources.js: Difference between revisions

Content deleted Content added
stepping back to version 22:48, 18 June 2025 (last one fails
line spacing
Line 39:
 
}
 
 
function Ohc_remove_urls() {
Line 90 ⟶ 89:
regex(/(\|\s*url\s*\=\s*)(https?:[^|{}#\s]+\.html?)\?[^|}]{1,5}(?=[\s\[\]|{}<>])/gi, '$1$2'); //rem link tracking
regex(/(\|\s*url\s*\=\s*|\[)(https?:\/\/books\.google\.[^\/]+\/books\?id=\w{12}&pg=PA\d{1,3})&dq[^\s|}]+(?=\s?[|}])/gi, '$1$2'); //rem browser optimisation
 
 
}
Line 498 ⟶ 496:
regex(/(\|\s*(?:newspaper|website|work)\s*\=\s*[^=}<>]*(?:\|[^}<>]*|))\|\s?(?:newspaper|website|work)\s*\=\s*[^\}|]+(?=\s*[|}])/g, '$1'); //universal work and aliases
 
//unwinding of unnecessary pipes
regex(/\[\[([^\]\|]*)\|\1(?=\]\])/gi, '[[$1');
Line 590 ⟶ 587:
 
}
 
 
function ohc_unprotect_urls()
{
//removes protection put in place by function ohc_protect_fmt (all cats, templates etc.)
 
//removes protection put in place by function ohc_protect_fmt (all cats, templates etc.)
regex(/⍌([0-9]+)⍍/g, function(x, n) {
var res = linkmap[n];
Line 640 ⟶ 635:
Ohc_sources_cleanup();
ohc_unprotect_urls();
 
 
Ohc_Source_edit_summary();
Line 677 ⟶ 671:
}
 
function prevDef ( e ) {
e.preventDefault();