Изменения

Перейти к навигации Перейти к поиску
параметр _style: вместо отдельной настройки _tag & _sep & ... можно задать некий стиль, который будет определять остальное
Строка 61: Строка 61:  
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]
Строка 110: Строка 120:  
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
Анонимный участник

Реклама:

Навигация