Jump to content

Module:Module wikitext: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
Jackmcbarn (talk | contribs)
preprocess it
Jackmcbarn (talk | contribs)
rework to support multiple calls and allow caching main
Line 1: Line 1:
local p = {}
local p = {}

p.text = ''


function p.main()
function p.main()
return text
end
end


function p._setText(text, preprocessFrame)
function p._addText(text, preprocessFrame)
if preprocessFrame ~= false then
if preprocessFrame ~= false then
text = (preprocessFrame or mw.getCurrentFrame()):preprocess(text)
text = (preprocessFrame or mw.getCurrentFrame()):preprocess(text)
end
end
p.main = function() return text end
p.text = p.text .. text
end
end



Revision as of 17:41, 7 September 2020

local p = {}

p.text = ''

function p.main()
	return text
end

function p._addText(text, preprocessFrame)
	if preprocessFrame ~= false then
		text = (preprocessFrame or mw.getCurrentFrame()):preprocess(text)
	end
	p.text = p.text .. text
end

return p