Модуль:Песочница/Pok: различия между версиями
Pok (обсуждение | вклад) Нет описания правки |
Pok (обсуждение | вклад) Нет описания правки |
||
| Строка 5: | Строка 5: | ||
return (s:gsub("^%s*(.-)%s*$", "%1")) | return (s:gsub("^%s*(.-)%s*$", "%1")) | ||
end | end | ||
local function parse_keys_from_template(content, switches) | local function parse_keys_from_template(content, switches) | ||
| Строка 135: | Строка 133: | ||
local switchConfigs = { | local switchConfigs = { | ||
card = { | card = { | ||
wrapper = function(key, tplCalls) | wrapper = function(key, tplCalls) | ||
if not tplCalls or #tplCalls == 0 then return "" end | if not tplCalls or #tplCalls == 0 then return "" end | ||
return "|" .. mw.text.encode(key) .. "|" .. table.concat(tplCalls, " ") .. "" | return "{{card|" .. mw.text.encode(key) .. "|" .. table.concat(tplCalls, " ") .. "}}" | ||
end | end | ||
}, | }, | ||
title = { | title = { | ||
wrapper = function(key, tplCalls) | wrapper = function(key, tplCalls) | ||
local parts = {} | local parts = {} | ||
| Строка 186: | Строка 182: | ||
table.insert(switchKeyOrder[sw], key) | table.insert(switchKeyOrder[sw], key) | ||
end | end | ||
local param = | local param = sw | ||
table.insert(switchKeyToTemplates[sw][key], "{{" .. tplPath .. "|" .. param .. "|" .. key .. "}}") | table.insert(switchKeyToTemplates[sw][key], "{{" .. tplPath .. "|" .. param .. "|" .. key .. "}}") | ||
end | end | ||