Module:Sortkey: Difference between revisions
From Zoophilia Wiki
Jump to navigationJump to search
meta>TheDJ very simple lua module to escape html data attribute for the sortkey |
meta>TheDJ if the sortkey contains a sortkey, then blank. Nesting is |
||
Line 1: | Line 1: | ||
local p = {} | local p = {} | ||
function p.encode(frame) | 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(str, "sortkey") then | |||
return ""; | |||
end | |||
return mw.text.encode(frame.args[1]) | return mw.text.encode(frame.args[1]) | ||
end | end | ||
return p | return p |
Revision as of 21:29, 22 June 2018
Documentation for this module may be created at Module:Sortkey/doc
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(str, "sortkey") then
return "";
end
return mw.text.encode(frame.args[1])
end
return p