Jump to content

Module:POTD titletext

Permanently protected module
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Frietjes (talk | contribs) at 13:17, 14 September 2015 (module for more fully expanding the POTD texttitle). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

local p = {}
function p.main(frame)
	local date = frame.args[1]
	local success, result = pcall(frame.expandTemplate, frame, {title = 'POTD/' .. date, args = { 'texttitle'}})
	if success then
		local t = mw.ustring.gsub(result, '[%s]', ' ')
		t = mw.ustring.gsub(t, '.*texttitle[%s]*=(.*)|[%s]*caption.*', '%1')
		return t
	else
		return '?'
	end
end

return p