2734
правки
Изменения
Нет описания правки
if aliases or modAliases then
local frames = {}
for frame in mw.text.gsplit( args[1], '%s*;%s*' ) do
local frameParts = p.getParts( frame, args["мод"] )
--- Обработка фреймов
local first = true
for frame in mw.text.gsplit(args[1], '%s*;%s*') do
local item
if frame ~= '' or frame == '' and animated then
local expandedFrames = {}
for aliasFrame in mw.text.gsplit(alias, '%s*;%s*') do
local aliasParts = p.getParts(aliasFrame)
aliasParts.title = frameParts.title or aliasParts.title or ''
aliasParts.text = frameParts.text or aliasParts.text or ''
table.insert( expandedFrames, stringmw.ustring.format(
'[%s]%s:%s,%s[%s]',
aliasParts.title, aliasParts.mod, aliasParts.name, aliasParts.num, aliasParts.text
function p.getParts(frame, mod)
local parts = {}
parts.title = mw.ustring.match(frame, '^%[%s*([^%]]+)%s*%]')
parts.mod = mw.text.trim(mw.ustring.match(frame, '([^:%]]+):') or mod or '')
parts.name = mw.text.trim(mw.ustring.sub(frame, nameStart, (mw.ustring.find(frame, '[,%[]', nameStart) or 0) - 1))
parts.num = math.floor(mw.ustring.match(frame, ',%s*(%d+)') or 0)
if parts.num == 0 then
parts.num = nil
end
parts.text = mw.ustring.match(frame, '%[%s*([^%]]+)%s*%]$')
return parts