Модуль:Entity Lookup: различия между версиями

Нет описания правки
Нет описания правки
 
Строка 14: Строка 14:
local name = entity.name or ""
local name = entity.name or ""
local label = mw.ustring.lower(entity.label or "")
local label = mw.ustring.lower(entity.label or "")
local suffix = mw.ustring.lower(entity.suffix or "")
local suffix = ""


if useSuffix and suffix ~= "" then
if useSuffix then
local parts = {}
suffix = mw.ustring.lower(entity.suffix or "")
for part in tostring(suffix):gmatch("[^,;]+") do
 
part = part
if suffix ~= "" then
if part ~= "" then
local parts = {}
parts[#parts + 1] = part
for part in tostring(suffix):gmatch("[^,;]+") do
part = mw.text.trim(part)
if part ~= "" then
parts[#parts + 1] = part
end
end
end
suffix = table.concat(parts, ", ")
end
end
suffix = table.concat(parts, ", ")
end
end