Module:Recent changes article requests

From Uncyclopedia, the content-free encyclopedia
Jump to navigation Jump to search

Documentation for this module may be created at Module:Recent changes article requests/doc

local p = {}

local getArgs = require('Module:Arguments')

local function getArgs(frame)
	-- Fetches the arguments from the parent frame. Whitespace is trimmed and
	-- blanks are removed.
	mArguments = require('Module:Arguments')
	return mArguments.getArgs(frame, {parentOnly = true})
end

function p.full(frame)

	local args = getArgs(frame)
	local list = 'Template:Recent changes article requests/list'

	if list ~= nil then
		-- analogous to {{msgnw:{{{1}}}}}
		local str = mw.text.decode(frame:preprocess { text = '{{msgnw:' .. list .. '}}' })
		str = mw.ustring.gsub(str, '<includeonly>.-</includeonly>', '')
		str = mw.ustring.gsub(str, '%s*|?%s*(.-)%s*\n', '* [[%1]]\n')
		-- render
		return str
	end
end

return p