Module:Test: Difference between revisions

From ProleWiki, the proletarian encyclopedia
m (Testing splitting page contents by line)
m (Using separator category instead of \n)
Line 2: Line 2:
function p.test( frame )
function p.test( frame )
local pageContent = mw.title.getCurrentTitle():getContent()
local pageContent = mw.title.getCurrentTitle():getContent()
local pagesLines = mw.text.split(pageContent,'\n')
local pagesLines = mw.text.split(pageContent,'%s')
return pageLines[1]
return pageLines[1]
end
end
return p
return p

Revision as of 17:35, 14 April 2024

local p = {}
function p.test( frame )
	local pageContent = mw.title.getCurrentTitle():getContent()
	local pagesLines = mw.text.split(pageContent,'%s')
	return pageLines[1]
end
return p