Module:Sandbox/Aidan9382/Link once: Difference between revisions

Content deleted Content added
better comments
Dont process category links
 
(One intermediate revision by the same user not shown)
Line 58:
%[%[.-%]%] wouldn't work for the exact same testcase for other reasons
--]=]
local options = options or {follow_redirects=true}
local newText = {}
local scannerPosition = 1
Line 84:
 
local newContainer = (openWikilinks[#openWikilinks] or {Text=newText}).Text
if wlTarget:find("^[Ii]mage:") or wlTarget:find("^[Ff]ile:") or wlTarget:find("^[Cc]ategory:") then --Files/Images/Categories aren't processed (they aren't really wikilinks)
newContainer[#newContainer+1] = wlText
else
Line 128:
local args = require('Module:Arguments').getArgs(frame)
return linkOnce(args[1] or "", {
follow_redirects = yesno(args.follow_redirects) or falsetrue,
})
end