View source for Module:Sort
From The Goon Show Depository
You do not have permission to edit this page, for the following reason:
You can view and copy the source of this page.
local getArgs = require('Module:Arguments').getArgs
local p = {}
local demo = function(s) return '<' .. string.sub(s,2,-8) .. '</span>' end
-- Protect against sortkey nesting.
-- Example: {{sort|{{dts|2013|07|07}}|{{dts|1990|12|01}}}}
local encode = function(s) return (string.find(s, "sortkey") or string.find(s, "data-sort-value"))
and "" or mw.text.encode(s) end
function p._name(args)
local sortkey = encode( ((args[4] or args.sort or '') ~= '')
and (args[4] or args.sort)
or ((args[2] or args.last or '{{{last}}}')..', '..(args[1] or args.first or '{{{first}}}')))
local span = (args[1] or args.first or '{{{first}}}')..' '..(args[2] or args.last or '{{{last}}}')
if ((args.nolink or '') == '') and ((args[1] or args.first or '')..(args[2] or args.last or '')..(args.dab or '') ~= '-') then
if (args[3] or args.link or '') ~= '' then
span = (args[3] or args.link) .. '|' .. span
elseif (args.dab or '') ~= '' then
000
1:0
Templates used on this page:
Return to Module:Sort.