Module:Sandbox/RobLa/Foo: Difference between revisions

From Galim Synthesizers
Jump to navigation Jump to search
MediaWIki>Pppery
(Rm usage of module I'm about to delete)
 
m (1 revision imported)
 
(No difference)

Latest revision as of 15:37, 11 November 2022

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