Jump to content

Module:Sandbox/Alex 21

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Alex 21 (talk | contribs) at 04:39, 18 July 2018. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

local p = {}

local function getTitle(title)
	local success, titleObj = pcall(mw.title.new, title)
	if success then return titleObj
	else return nil end
end

function p.main(frame)
	local args = require('Module:Arguments').getArgs(frame, {frameOnly = true})
	
	local content = string.gsub(getTitle(args[1]):getContent() or "", "[\r\n]", "")
	
	return content
end

return p