Module:Sandbox/Frietjes: Difference between revisions

Content deleted Content added
No edit summary
No edit summary
Line 2:
-- {{subst:#invoke:CFB schedule/convert|table|...}}
local p = {}
 
local function parseHeader(s)
return '{' .. s .. '}'
end
 
local function parseFooter(s)
return '{' .. s .. '}'
end
 
local function parseEntry(s)
return '{' .. s .. '}'
end
 
function p.table(frame)
local res = ''
for t in mw.text.gsplit(frame.args[1] or '', '{{[_%s]*CFB[_%s]*Schedule[_%s]*') do
tlocal s = t:match( '^%s*(.-)%s*$' )
if mw.ustring.sub(t,-2) == '}}' then
ress = res .. 'CFB schedule ' .. mw.ustring.sub(ts,1,-3) .. '\n~MARK~\n'
if mw.ustring.sub(s,1,5) == 'Entry' then
res = res .. parseEntry(mw.ustring.sub(s,6))
elseif mw.ustring.sub(s,1,5) == 'Start' then
res = res .. parseHeader(mw.ustring.sub(s,6))
elseif mw.ustring.sub(s,1,3) == 'End' then
res = res .. parseFooter(mw.ustring.sub(s,4))
else
res = res .. t
end
else
res = res .. t
end
end