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 14:02, 14 September 2015. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

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')
		t = mw.ustring.gsub(result, '[%s][%s]*$', '')
		return t
	else
		return '?'
	end
end

return p