Изменения

Строка 46: Строка 46:  
end
 
end
 
 
 +
local g_alias = args._alias
 
local tname = args.t or args._t or args.template or args._template
 
local tname = args.t or args._t or args.template or args._template
 
local ucFirst = yesno(args.u or args._u, false)
 
local ucFirst = yesno(args.u or args._u, false)
Строка 151: Строка 152:  
end
 
end
 
end
 
end
+
-- если задан локальный алиас, то он используется вместо _template и глобального alias (консенсусная реализация, не меняю)
local targs_tname = targs._alias
+
-- иначе используется _template = tname и _alias = g_alias, если последний задан
 +
-- пример: {{стопка примеров|t=Википедия:Часто_используемые_источники/Статус|_alias=/Статус|...}} даст
 +
-- <code>{{/Статус|...}}</code> → {{Википедия:Часто_используемые_источники/Статус|...}}
 +
local targs_tname = targs._alias  
 +
local local_alias = nil
 
if not targs_tname then
 
if not targs_tname then
 
targs_tname = tname
 
targs_tname = tname
 +
local_alias = g_alias
 
end
 
end
table.insert(targs, 1, targs_tname)
+
targs._sep, targs._style, targs._nobr, targs._nocat, targs._spaced, targs._comment_sep = sep, style, nobr,
+
targs._sep, targs._style, targs._nobr, targs._nocat, targs._spaced, targs._comment_sep, targs._template, targs._alias = sep, style, nobr,
nocat, spaced, comment_sep
+
nocat, spaced, comment_sep, targs_tname, local_alias
 
 
 
if not targs._prefix then
 
if not targs._prefix then
Анонимный участник