sctools>Alistair3149 No edit summary |
(Created page with "local p = {} function p.linkcapture(frame) local linkString = frame.args[1] or "" local linkText = string.match(linkString, "%[%[([^%]]+)%]%]") local linkTextText = string.match(linkString, "%[%[[^%|]+%|([^%}]+)%]%]") if (linkTextText ~= nil) then return linkTextText elseif (linkText ~= nil) then return linkText else return linkString end end return p") |
(No difference)
|
Revision as of 06:45, 28 January 2023
This documentation is transcluded from Module:Link capture/doc. Changes can be proposed in the talk page.
local p = {}
function p.linkcapture(frame)
local linkString = frame.args[1] or ""
local linkText = string.match(linkString, "%[%[([^%]]+)%]%]")
local linkTextText = string.match(linkString, "%[%[[^%|]+%|([^%}]+)%]%]")
if (linkTextText ~= nil) then
return linkTextText
elseif (linkText ~= nil) then
return linkText
else
return linkString
end
end
return p