Модуль:Serialization/EntityTableSelector: различия между версиями
Pok (обсуждение | вклад) Нет описания правки |
Pok (обсуждение | вклад) Нет описания правки |
||
| Строка 195: | Строка 195: | ||
local renderSelector | local renderSelector | ||
local renderTableById | local renderTableById | ||
local function renderPlainEntries(entries) | |||
if type(entries) ~= "table" then | |||
return "" | |||
end | |||
local result = {} | |||
for _, entry in ipairs(entries) do | |||
if type(entry) == "table" and trim(entry.id) ~= "" then | |||
result[#result + 1] = formatContent(entry) | |||
end | |||
end | |||
return table.concat(result) | |||
end | |||
local function renderChildren(children, visited) | local function renderChildren(children, visited) | ||
| Строка 353: | Строка 368: | ||
local selector = normalizeSelector(data) | local selector = normalizeSelector(data) | ||
if not selector then | if not selector then | ||
local plainEntries = renderPlainEntries(data) | |||
if plainEntries ~= "" then | |||
return frame:preprocess(plainEntries) | |||
end | |||
return "" | return "" | ||
end | end | ||