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

Нет описания правки
Нет описания правки
 
(не показаны 3 промежуточные версии этого же участника)
Строка 1314: Строка 1314:
end
end


local outputType = (args.type or "list"):lower()
local outputType = (args.type or "list")


local bullet = mw.text.unstripNoWiki(args.prefix or "* ")
local bullet = mw.text.unstripNoWiki(args.prefix or "* ")
local sep = mw.text.unstripNoWiki(args.sep or ": ")
local sep = mw.text.unstripNoWiki(args.sep or ": ")
if outputType == "none" then
if outputType == "none" then
bullet = ""
bullet = ""
sep = ""
sep = ""
elseif outputType == "revertList" then
sep = mw.text.unstripNoWiki(args.sep or " ")
end
end


Строка 1411: Строка 1414:
if outputType == "enum" then
if outputType == "enum" then
line = vStr .. " " .. keyStr
line = vStr .. " " .. keyStr
elseif outputType == "revertList" then
line = bullet .. vStr .. sep .. keyStr
else
else
line = bullet .. keyStr .. sep .. vStr
line = bullet .. keyStr .. sep .. vStr
Строка 1426: Строка 1431:
if outputType == "enum" then
if outputType == "enum" then
return frame:preprocess(table.concat(out, ", "))
return frame:preprocess(table.concat(out, ", "))
elseif outputType == "list" then
elseif outputType == "list" or outputType == "revertList" then
return frame:preprocess(table.concat(out, "\n"))
return frame:preprocess(table.concat(out, "\n"))
else
else