Модуль:Сущность: различия между версиями
Pok (обсуждение | вклад) мНет описания правки |
Pok (обсуждение | вклад) мНет описания правки |
||
| Строка 131: | Строка 131: | ||
tagSet = {} | tagSet = {} | ||
} | } | ||
if frame then | |||
local mainArgs = getArgs(frame, { removeBlanks = false }) | |||
local rawTopCardTag = trim(mainArgs.cardTag or "") | |||
if rawTopCardTag and rawTopCardTag ~= "" then | |||
local ok, processed = pcall(function() return frame:preprocess(rawTopCardTag) end) | |||
local topCardTag = "" | |||
if ok and processed then topCardTag = trim(processed) else topCardTag = trim(rawTopCardTag) end | |||
if topCardTag ~= "" then | |||
for tag in string.gmatch(topCardTag, "[^,]+") do | |||
local t = trim(tag) | |||
if t ~= "" and not merged.tagSet[t] then | |||
merged.tagSet[t] = true | |||
table.insert(merged.tags, t) | |||
end | |||
end | |||
end | |||
end | |||
end | |||
for _, callKey in ipairs(keyOrder or {}) do | for _, callKey in ipairs(keyOrder or {}) do | ||
local entries = keyToTemplates[callKey] or {} | local entries = keyToTemplates[callKey] or {} | ||
| Строка 402: | Строка 423: | ||
local entry | local entry | ||
if sw == "card" then | if sw == "card" then | ||
entry = { | entry = { | ||
tplLabel = tplLabelStr, | tplLabel = tplLabelStr, | ||
tplContent = tplContentStr, | tplContent = tplContentStr, | ||
cardTag = | cardTag = parsed.cardTag, | ||
source = { kind = kind, name = name, pathName = pathName, tplPath = tplPath }, | source = { kind = kind, name = name, pathName = pathName, tplPath = tplPath }, | ||
priority = priority, | priority = priority, | ||
| Строка 491: | Строка 504: | ||
local entry | local entry | ||
if sw == "card" then | if sw == "card" then | ||
entry = { | entry = { | ||
tplLabel = makeTplCall(tplPath, "cardLabel", key, ""), | tplLabel = makeTplCall(tplPath, "cardLabel", key, ""), | ||
tplContent = makeTplCall(tplPath, "cardContent", key, ""), | tplContent = makeTplCall(tplPath, "cardContent", key, ""), | ||
source = { kind = "", name = tplPath, pathName = tplPath, tplPath = tplPath }, | source = { kind = "", name = tplPath, pathName = tplPath, tplPath = tplPath }, | ||
priority = 1, | priority = 1, | ||