Module:Sandbox/RobLa/Foo
Jump to navigation
Jump to search
Testing my template: Lua error at line 8: attempt to index global 'pagetext' (a nil value).
local p = {}
function p.captions( frame )
local pagename = frame.args[1]
pagetitle = mw.title.new( pagename )
pagetext = pagetitle:getContent()
statusdates = "* "
for line in pagetext:gmatch( "[^\r\n]+" ) do
m = line:match( "^== ([^=]*) ==" )
if m then
statusdates = statusdates .. "\n* " .. m
end
end
return statusdates
end
return p