Изменения
параметр _style: вместо отдельной настройки _tag & _sep & ... можно задать некий стиль, который будет определять остальное
local prefix = args._prefix or ''
local prefix = args._prefix or ''
local postfix = args._postfix or ''
local postfix = args._postfix or ''
local nwt = mw.html.create(tag):tag(tag) --"no-wiki tag", внутри него шаблон не вызывается
local style = args._style or ''
if style == 'pre' then
tag = nil
container = 'pre'
sep = ''
elseif style == '*pre' then
tag = nil
container = '*pre'
sep = ''
end
local nwt = tag and mw.html.create(tag):tag(tag) --"no-wiki tag", внутри него шаблон не вызывается
local content = nowiki(prefix) .. '{{' --для накопления содержимого тэга
local content = nowiki(prefix) .. '{{' --для накопления содержимого тэга
local tname = args._template or args[1]
local tname = args._template or args[1]
end
end
content = content .. '}}' .. nowiki(postfix)
content = content .. '}}' .. nowiki(postfix)
nwt:wikitext(content):done()
if tag then
nwt:wikitext(content):done()
else
local container_args = {}
container_args[1] = content
nwt = expand(frame, container, container_args)
end
return tostring(nwt) .. ' ' .. sep .. ' ' .. prefix .. tostring(expand(frame, tname, targs)) .. postfix
return tostring(nwt) .. ' ' .. sep .. ' ' .. prefix .. tostring(expand(frame, tname, targs)) .. postfix