Модуль:Сущность: различия между версиями
Pok (обсуждение | вклад) Нет описания правки |
Pok (обсуждение | вклад) Нет описания правки |
||
| Строка 612: | Строка 612: | ||
local valuePattern = mw.text.unstripNoWiki(args.value_pattern or "(.*)") | local valuePattern = mw.text.unstripNoWiki(args.value_pattern or "(.*)") | ||
local valueReplace = mw.text.unstripNoWiki(args.value_replace or "\\1") | local valueReplace = mw.text.unstripNoWiki(args.value_replace or "\\1") | ||
local globalPattern = mw.text.unstripNoWiki(args.pattern or args.Pattern or "") | |||
local globalReplace = mw.text.unstripNoWiki(args.replace or args.Replace or "\\1") | |||
local out = {} | local out = {} | ||
| Строка 690: | Строка 693: | ||
end | end | ||
local result | |||
if outputType == "enum" then | if outputType == "enum" then | ||
result = frame:preprocess(table.concat(out, ", ")) | |||
else | else | ||
result = frame:preprocess(table.concat(out, "\n")) | |||
end | |||
if globalPattern and globalPattern ~= "" then | |||
result = apply_pattern(result, globalPattern, globalReplace) | |||
end | end | ||
return result | |||
end | end | ||
return p | return p | ||