Module:Delink: Difference between revisions

70 bytes added ,  2 December 2020
remove interwiki prefixes when using delinkTarget
No edit summary
(remove interwiki prefixes when using delinkTarget)
 
Line 40: Line 40:
if s:match("|") then -- Find if we're dealing with a piped link.
if s:match("|") then -- Find if we're dealing with a piped link.
         s = s:match("^%[%[(.+)|.-%]%]")
         s = s:match("^%[%[(.+)|.-%]%]")
        -- Remove w: interwiki prefixes
        s = s:gsub("^w:", "")
         -- Remove new lines from the display of multiline piped links,
         -- Remove new lines from the display of multiline piped links,
         -- where the pipe is before the first new line.
         -- where the pipe is before the first new line.