2734
правки
Изменения
Нет описания правки
function p.getParts(frame, mod)
local parts = {}
parts.title = mw.ustring.frame:match(frame, '^%[%s*([^%]]+)%s*%]')
parts.mod = mw.text.trim( frame:match( '([^:%]]+):' ) or mod or '' )
local vanilla = {v = 1, vanilla = 1, mc = 1, minecraft = 1} if parts.mod == '' or vanilla[mw.ustring.lower(parts.mod)] then
parts.mod = nil
end
local nameStart = (mw.ustring.frame:find(frame, ':') or mw.ustring.frame:find(frame, '%]') or 0 ) + 1
if nameStart - 1 == #frame then
nameStart = 1
end
parts.name = mw.text.trim(mw.ustring.sub(frame, nameStart, (mw.ustring.find(frame, '[,%[]', nameStart) or 0) - 1))