Module:Subobjecthelper

From RuneRealm Wiki

This is the current revision of this page, as edited by Alex (talk | contribs) at 00:13, 17 October 2024 (Created page with "local p = {} function p.main(frame) local args = frame.args local subobj = {} for k,v in pairs(args) do if not (k == 'splitpoint' or k == 'subobjectname') then v = v:gsub('[\r\n]', '') subobj[k] = mw.text.split(v, args.splitpoint or '&split&') end end if args.subobjectname then mw.smw.subobject(subobj, args.subobjectname) else mw.smw.subobject(subobj) end end return p"). The present address (URL) is a permanent link to this version.

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
Module documentation
This documentation is transcluded from Template:No documentation/doc. [edit] [history] [purge]
This module does not have any documentation. Please consider adding documentation at Module:Subobjecthelper/doc. [edit]
local p = {}

function p.main(frame)
	local args = frame.args
	local subobj = {}
	for k,v in pairs(args) do
		if not (k == 'splitpoint' or k == 'subobjectname') then
			v = v:gsub('[\r\n]', '')
			subobj[k] = mw.text.split(v, args.splitpoint or '&split&')
		end
	end
	if args.subobjectname then
		mw.smw.subobject(subobj, args.subobjectname)
	else	
		mw.smw.subobject(subobj)
	end
end

return p