Remove MediaWiki links

I often edit on Wikipedia. The following snippet removes MediaWiki links.

# popclip
name: Remove MediaWiki links
icon: square filled monospaced [[
javascript: popclip.pasteText(popclip.input.text.replace(/\[\[(?:[^|\]]*\|)?([^\]]+)\]\]/g, '$1'))
description: Remove MediaWiki links

(How to install extension snippets)

Before:

‘’‘Steven Paul Jobs’‘’ (February 24, 1955 – October 5, 2011) was an American [[Entrepreneurship|entrepreneur]], [[industrial design]]er, [[business magnate]], [[media proprietor]], and investor.

After:

‘’‘Steven Paul Jobs’‘’ (February 24, 1955 – October 5, 2011) was an American entrepreneur, industrial designer, business magnate, media proprietor, and investor.

@nick A strikethrough look for the icons would be handy for all snippets related to removing stuff.

3 Likes

Nice idea!

WIP:

2 Likes

This is nice, thank you!

1 Like

For those interested, the snippet with strikethrough would be:

#popclip
name: Remove Wikilinks
icon: strike [[
javascript: popclip.pasteText(popclip.input.text.replace(/\[\[(?:[^|\]]*\|)?([^\]]+)\]\]/g, '$1'))
description: Removes wikilinks
stay visible: true
2 Likes

Nice! It’s worth noting that the strike attribute only works in the current beta release and not in the production release (2023.9).