Изменения
мСтрока 64:
Строка 64:
− +
Строка 82:
Строка 82:
− +
− +
Строка 111:
Строка 111:
− table.remove(args,1) --из именованного параметра в отсутствие неименованных - в этой строчке вреда нет в любом случае),+
− end --больше его обрабатывать не надо+
+
+
Строка 132:
Строка 134:
− +
− else --через "{{=}}", не сбивали порядок+
+
Строка 157:
Строка 160:
− +
− +
оформление
local prefix = args._prefix or args['_pre-text'] or ''
local prefix = args._prefix or args['_pre-text'] or ''
local postfix = args._postfix or args['_post-text'] or ''
local postfix = args._postfix or args['_post-text'] or ''
local comment = args._comment or ''
local comment = args._comment
local comment_sep = args._comment_sep or ' '
local comment_sep = args._comment_sep or ' '
local nobr = yesno(args._nobr, false)
local nobr = yesno(args._nobr, false)
tag = nil
tag = nil
container = 'pre'
container = 'pre'
sep = '<div style="margin-left: 50%; margin-bottom: 1em;"><big>↓</big></div>\n' --слегка изменённое содержимое шаблона t:sp↓
sep = '<div style="margin-left: 50%; margin-bottom: 1em;"><big>↓</big></div>\n' --слегка изменённое содержимое шаблона sp↓
elseif style == '*pre↓' then
elseif style == '*pre↓' then
tag = nil
tag = nil
container = '*pre'
container = '*pre'
sep = '<div style="margin-left: 50%; margin-bottom: 1em;"><big>↓</big></div>\n' --слегка изменённое содержимое шаблона t:sp↓
sep = '<div style="margin-left: 50%; margin-bottom: 1em;"><big>↓</big></div>\n' --слегка изменённое содержимое шаблона sp↓
elseif style == 'wikitable' then
elseif style == 'wikitable' then
tag = 'tt'
tag = 'tt'
if args._template == nil then --имя вызываемого шаблона в неименованном первом параметре (или же взято из названия страницы или
if args._template == nil then --имя вызываемого шаблона в неименованном первом параметре (или же взято из названия страницы или
--из именованного параметра в отсутствие неименованных — в следующей строчке вреда нет в любом случае),
--больше его обрабатывать не надо
table.remove(args,1)
end
if link then
if link then
content = content .. '[[Шаблон:' .. tname .. '|' .. tname .. ']]'
content = content .. '[[Шаблон:' .. tname .. '|' .. tname .. ']]'
targs[param] = process_nowiki_equals(value)
targs[param] = process_nowiki_equals(value)
content = content .. (spaced and i == 1 and ' ' or '') .. '|' .. nowiki(param) .. '=' .. nowiki(value) .. (spaced and ' ' or '') .. endl
content = content .. (spaced and i == 1 and ' ' or '') .. '|' .. nowiki(param) .. '=' .. nowiki(value) .. (spaced and ' ' or '') .. endl
left_shift = left_shift+1 --переменная нужна, чтобы квазинумерованные параметры, переданные
left_shift = left_shift+1 --переменная нужна, чтобы квазинумерованные параметры, переданные через "{{=}}",
--не сбивали порядок
else
targs[k - left_shift] = process_nowiki_equals(v)
targs[k - left_shift] = process_nowiki_equals(v)
content = content .. '|' .. nowiki(v) .. endl
content = content .. '|' .. nowiki(v) .. endl
expand_result = tostring(expand(frame, tname, targs))
expand_result = tostring(expand(frame, tname, targs))
if (expand_result:sub(1, 2) == '{|') then
if expand_result:sub(1, 2) == '{|' then
sep = sep .. '\n'
sep = sep .. '\n'
end
end
return tostring(nwt) .. ' ' .. sep .. prefix .. expand_result .. postfix .. (comment ~= '' and comment_sep .. comment or '')
return tostring(nwt) .. ' ' .. sep .. prefix .. expand_result .. postfix .. (comment and comment_sep .. comment or '')
end
end
return p
return p