Изменения
Перейти к навигации
Перейти к поиску
Строка 60:
Строка 60:
− +
− +
Строка 73:
Строка 73:
− +
Строка 120:
Строка 120:
− +
Строка 129:
Строка 129:
− +
префикс и постфикс - это немного другое, изменил на pre-text и post-text
local link = require('Module:Yesno')(args._link, false)
local link = require('Module:Yesno')(args._link, false)
local endl = args._endl or ''
local endl = args._endl or ''
local prefix = args._prefix or ''
local pre_text = args._pre-text or ''
local postfix = args._postfix or ''
local post_text = args._post-text or ''
local style = args._style or ''
local style = args._style or ''
if style == 'pre' then
if style == 'pre' then
end
end
local nwt = tag and mw.html.create(tag):tag(tag) --"no-wiki tag", внутри него шаблон не вызывается
local nwt = tag and mw.html.create(tag):tag(tag) --"no-wiki tag", внутри него шаблон не вызывается
local content = nowiki(prefix) .. '{{' --для накопления содержимого тэга
local content = nowiki(pre_text) .. '{{' --для накопления содержимого тэга
local tname = args._template or args[1]
local tname = args._template or args[1]
if tname == nil then --если имя шаблона содержит знак "=" (работает, только если нет неименованных параметров)
if tname == nil then --если имя шаблона содержит знак "=" (работает, только если нет неименованных параметров)
end
end
end
end
content = content .. '}}' .. nowiki(postfix)
content = content .. '}}' .. nowiki(post_text)
if tag then
if tag then
nwt:wikitext(content):done()
nwt:wikitext(content):done()
end
end
return tostring(nwt) .. ' ' .. sep .. ' ' .. prefix .. tostring(expand(frame, tname, targs)) .. postfix
return tostring(nwt) .. ' ' .. sep .. ' ' .. pre_text .. tostring(expand(frame, tname, targs)) .. post_text
end
end
return p
return p