Toggle menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Module:Test: Difference between revisions

From ProleWiki, the proletarian encyclopedia
m (I think it doesn't ignore empty lines, which is something to consider)
m (Testing length operator)
Line 3: Line 3:
local pageContent = tostring(mw.title.getCurrentTitle():getContent())
local pageContent = tostring(mw.title.getCurrentTitle():getContent())
local pageLines = mw.text.split(pageContent,'\n',true)
local pageLines = mw.text.split(pageContent,'\n',true)
return pageLines[3]
return #pageLines
end
end
return p
return p

Revision as of 17:44, 14 April 2024

local p = {}
function p.test( frame )
	local pageContent = tostring(mw.title.getCurrentTitle():getContent())
	local pageLines = mw.text.split(pageContent,'\n',true)
	return #pageLines
end
return p