Code that you insert on this page could contain malicious content capable of compromising your account. If you import a script from another page with "importScript", "mw.loader.load", "iusc", or "lusc", take note that this causes you to dynamically load a remote script, which could be changed by others. Editors are responsible for all edits and actions they perform, including by scripts. User scripts are not centrally supported and may malfunction or become inoperable due to software changes. A guide to help you find broken scripts is available. If you are unsure whether code you are adding to this page is safe, you can ask at the appropriate village pump. This code will be executed when previewing this page.
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
$(function(){if(mw.config.get('wgNamespaceNumber')!==0){return}//Only on main namespacevarportlet=mw.util.addPortletLink(window.pipeHighlighterCustomPortlet||'p-tb','javascript:void(0)','Highlight piped links','t-pipehighlighter','Highlight piped links like [[Foo|Bar]]');$(portlet).on('click',function(){varlinks=$('#mw-content-text a');for(vari=0;i<links.length;i++){varlink=$(links[i]);varlinkText=link.text(),linkTitle=link.attr('title');varcolor=window.pipeHighlighterCustomColor||'#B3446C';// Check if link is pipedif(link.parents('.navbox').length||link.attr('class')==='extiw'||link.parents('.asbox-body').length||link.parents('.sistersitebox').length||link.parents('.infobox-header').length||link.parents('.infobox-label').length||link.parents('.mw-editsection').length||(link.parents('div.reflist').length||link.parents('div.refbegin').length)||// reflistslinkTitle==undefined||linkText===linkTitle||(linkTitle!==undefined&&linkText===linkTitle.toLocaleLowerCase())){// Not piped, so continue the loopcontinue;}else{// Piped, so check if it's a redirect or disambiguation linkif(link.hasClass('mw-redirect')&&link.css('color')==='rgb(0, 102, 0)'){// Is a colored redirect link, so prepend a colored pipelink.prepend('<span style="color: '+color+'; font-weight: bold">|</span>');}elseif(link.hasClass('mw-disambig')&&link.css('color')==='rgb(241, 118, 0)'){// Is a colored disambig link, so prepend a pipelink.prepend('<span style="color: '+color+'; font-weight: bold">|</span>');}elseif(link.hasClass('new')){// Is a redlinklink.prepend('<span style="color: '+color+'; font-weight: bold">|</span>');}else{// Is not a redirect nor a disambig link,// Or is a redirect or a disambig link without a custom color// This is intended for compatibility with other link highlighing scripts/gadgetslink.css('color',color);}}}});});