Изменения

fix
Строка 9: Строка 9:  
end
 
end
   −
function expand(frame, tname, args)
+
function expand(frame, tname, targs)
 
local success, result = pcall(
 
local success, result = pcall(
 
frame.expandTemplate,
 
frame.expandTemplate,
 
frame,
 
frame,
{title = template, args = targs}
+
{title = tname, args = targs}
 
)
 
)
 
if success then
 
if success then
Строка 20: Строка 20:  
return ''
 
return ''
 
end
 
end
 +
--return frame:expandTemplate({title = tname, args = args})
 
end
 
end
   Строка 28: Строка 29:  
sep =  args._sep or '→'
 
sep =  args._sep or '→'
 
nwt = mw.html.create(tag):tag(tag)
 
nwt = mw.html.create(tag):tag(tag)
   
content = '{{'
 
content = '{{'
   Строка 35: Строка 35:  
else
 
else
 
tname = args[1]
 
tname = args[1]
table.remove(args,1)
+
table.remove(args,1)
args[1] = nil
   
end
 
end
   −
content = content .. tname
+
content = content .. tname
+
local targs = {}
local targs = {}
  −
   
for k, v in pairs(args) do
 
for k, v in pairs(args) do
 
if type(k) == 'number' then
 
if type(k) == 'number' then
Строка 56: Строка 53:  
nwt:wikitext(content):done()
 
nwt:wikitext(content):done()
   −
return tostring(nwt) .. sep .. tostring(expand(frame, tname, targs))
+
return tostring(nwt) .. ' ' .. sep .. ' ' .. tostring(expand(frame, tname, targs))
 
end
 
end
    
return p
 
return p
Анонимный участник