Module:Sandbox/K6ka/InfoboxLink: Difference between revisions
Jump to navigation
Jump to search
Content added Content deleted
No edit summary |
No edit summary |
||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
local getArgs = require('Module:Arguments').getArgs |
|||
local p = {} |
local p = {} |
||
function p.getTargetFromText( |
function p.getTargetFromText(frame) |
||
local text = frame.args[1] |
|||
return string.match( |
return string.match(frame, "^%[%[") |
||
end |
end |
||
function p.wrapInLink( |
function p.wrapInLink(frame) |
||
local args = getArgs(frame) |
|||
⚫ | |||
local text = args[1] |
|||
⚫ | |||
⚫ | |||
⚫ | |||
end |
end |
||
return '[[' .. |
return '[[' .. text .. ']]' |
||
end |
end |
||
Latest revision as of 17:22, 30 April 2019
Documentation for this module may be created at Module:Sandbox/K6ka/InfoboxLink/doc
local getArgs = require('Module:Arguments').getArgs
local p = {}
function p.getTargetFromText(frame)
local text = frame.args[1]
return string.match(frame, "^%[%[")
end
function p.wrapInLink(frame)
local args = getArgs(frame)
local text = args[1]
if(string.match(text, "^%[%[") ~= nil) then
return text
end
return '[[' .. text .. ']]'
end
return p