Jump to content

Module:Sortkey

Permanently protected module
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by TheDJ (talk | contribs) at 21:30, 22 June 2018. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

local p = {}
function p.encode(frame)
	local sortkey = frame.args[1];
	-- Protect against sortkey nesting.
	-- Example: {{sort|{{dts|2013|07|07}}|{{dts|1990|12|01}}}}
	if string.find(sortkey, "sortkey") then
		return "";
	end
    return mw.text.encode(sortkey)
end
return p