Module:links: Difference between revisions

33 bytes removed ,  16 February 2021
no edit summary
No edit summary
No edit summary
Line 18: Line 18:
-- of the same name.
-- of the same name.
local usub = mw.ustring.sub
local usub = mw.ustring.sub
local find = mw.ustring.find


local table_insert = table.insert
local table_insert = table.insert
Line 227: Line 226:
local allReconstructed = false
local allReconstructed = false


if find(text, "^*.") then
if text:find("^*.") then
allReconstructed = true
allReconstructed = true
end
end


-- Do we have embedded wikilinks?
-- Do we have embedded wikilinks?
if find(text, "[[", nil, true) then
if text:find("[[", nil, true) then
--[=[
--[=[
[[Special:WhatLinksHere/Template:tracking/links/alt-ignored]]
[[Special:WhatLinksHere/Template:tracking/links/alt-ignored]]
Line 251: Line 250:


-- Begins and ends with a wikilink tag
-- Begins and ends with a wikilink tag
if find(text, "^%[%[(.+)%]%]$") then
if text:find("^%[%[(.+)%]%]$") then
-- There are no [ ] in between.
-- There are no [ ] in between.
-- This makes the wikilink tag redundant.
-- This makes the wikilink tag redundant.
if find(text, "^%[%[[^%[%]]+%]%]$") then
if text:find("^%[%[[^%[%]]+%]%]$") then
require("Module:debug").track("links/redundant wikilink")
require("Module:debug").track("links/redundant wikilink")
else
else