More languages
More actions
m (Testing capture of headers) |
m (Oops, realized this isn't JavaScript and used concatenation operator) |
||
Line 6: | Line 6: | ||
for i=1,#pageLines do | for i=1,#pageLines do | ||
if mw.text.split(pageLines[i], '%s')[1] == '==' then | if mw.text.split(pageLines[i], '%s')[1] == '==' then | ||
render = render | render = render .. pageLines[i] | ||
end | end | ||
end | end |
Revision as of 17:54, 14 April 2024
local p = {}
function p.test( frame )
local pageContent = tostring(mw.title.getCurrentTitle():getContent())
local pageLines = mw.text.split(pageContent,'\n',true)
local render = ''
for i=1,#pageLines do
if mw.text.split(pageLines[i], '%s')[1] == '==' then
render = render .. pageLines[i]
end
end
return render
end
return p