« Module:Link capture » : différence entre les versions

De Wiki Electrolab
(Page créée avec « -------------------------------------------------------------------------------- -- Origin : https://starcitizen.tool -- -------------------------------------------------------------------------------- local p = {} function p.linkcapture(frame) local linkString = frame.args[1] or "" local linkText = string.match(linkString, "%[%[([^%]]+)%]%]") local linkTextText = string.match(linkString, "%[%[[^%|]+%|([^%}]+... »)
 
(Aucune différence)

Version actuelle datée du 1 mai 2023 à 08:43

Module documentation[view][edit][history][purge]
This documentation is transcluded from Module:Link capture/doc. Changes can be proposed in the talk page.

Module:Link capture implements the {{Link capture}} template.


--------------------------------------------------------------------------------
--                      Origin : https://starcitizen.tool                     --
--------------------------------------------------------------------------------

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
Les cookies nous aident à fournir nos services. En utilisant nos services, vous acceptez notre utilisation de cookies.