Content deleted Content added
No edit summary |
demo per request at WT:LUA |
||
(2 intermediate revisions by one other user not shown) | |||
Line 2:
local function ref( a )
a = a or ''
local refPattern = '
local p, _ = string.find( a
local contentPart, refPart
if p then
contentPart = string.sub( a, 1, p - 1 )
refPart = string.sub( a, p )
else
contentPart = a
refPart = ''
end
return contentPart, refPart
end
Line 23 ⟶ 24:
return p._main(args)
end
function p._main(args)
-- Main module code goes here.
Line 30 ⟶ 31:
local pt1, pt2 = ref( args[1] )
ret = "<i>" .. pt1 .. "</i> hello" .. pt2
return ret
end
return p
|