Jump to content

User:Nardog/Unpipe

From Wikipedia, the free encyclopedia

This is the current revision of this page, as edited by Nardog (talk | contribs) at 02:51, 19 January 2024 (Created page with '{{Tool warning}} {{Infobox Wikipedia user script |name=Unpipe |desc=<onlyinclude>Converts each piped link to a non-piped one if both lead to the same article</onlyinclude> |browsers=Chrome, Firefox, etc. (ES2017+ needed) |source=User:Nardog/Unpipe.js }} This script adds a button to the sidebar that converts piped links to non-piped ones where doing so does not change the destination of the link, to comply with WP:NOPIPE...'). The present address (URL) is a permanent link to this version.

(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)
Unpipe
DescriptionConverts each piped link to a non-piped one if both lead to the same article
UpdatedJune 10, 2024
    (27 days ago)
Browser supportChrome, Firefox, etc. (ES2017+ needed)
SourceUser:Nardog/Unpipe.js

This script adds a button to the sidebar that converts piped links to non-piped ones where doing so does not change the destination of the link, to comply with WP:NOPIPE and WP:NOTBROKEN. That is, if both "Foo" and "bar" in [[Foo|bar]] lead to the same article or section directly or indirectly (i.e. through a redirect or not), it's converted to [[bar]]. Links to non-main namespaces and to redirects ending in " (disambiguation)" will not be replaced. The button is available only in source mode (not 2017 editor).

Installation[edit]

Add the following to your common.js:

mw.loader.load('//en.wikipedia.org/w/index.php?title=User:Nardog/Unpipe.js&action=raw&ctype=text/javascript');

Or you may enable the script installer in Preferences → Gadgets and click "Install" in the infobox on this page.

Acknowledgements[edit]

This script relies on Pathoschild's TemplateScript framework.