Изменения

м
оформление
Строка 64: Строка 64:  
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)
Строка 82: Строка 82:  
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'
Строка 111: Строка 111:     
if args._template == nil then --имя вызываемого шаблона в неименованном первом параметре (или же взято из названия страницы или
 
if args._template == nil then --имя вызываемого шаблона в неименованном первом параметре (или же взято из названия страницы или
table.remove(args,1)      --из именованного параметра в отсутствие неименованных - в этой строчке вреда нет в любом случае),
+
                          --из именованного параметра в отсутствие неименованных в следующей строчке вреда нет в любом случае),
end                          --больше его обрабатывать не надо
+
                          --больше его обрабатывать не надо
 +
table.remove(args,1)
 +
end
 
if link then
 
if link then
 
content = content .. '[[Шаблон:' .. tname .. '|' .. tname .. ']]'
 
content = content .. '[[Шаблон:' .. tname .. '|' .. tname .. ']]'
Строка 132: Строка 134:  
targs[param] = process_nowiki_equals(value)
 
targs[param] = process_nowiki_equals(value)
 
content = content .. (spaced and i == 1 and ' ' or '') .. '&#124;' .. nowiki(param) .. '=' .. nowiki(value) .. (spaced and ' ' or '') .. endl
 
content = content .. (spaced and i == 1 and ' ' or '') .. '&#124;' .. nowiki(param) .. '=' .. nowiki(value) .. (spaced and ' ' or '') .. endl
left_shift = left_shift+1 --переменная нужна, чтобы квазинумерованные параметры, переданные
+
left_shift = left_shift+1 --переменная нужна, чтобы квазинумерованные параметры, переданные через "{{=}}",
else                          --через "{{=}}", не сбивали порядок
+
                          --не сбивали порядок
 +
else
 
targs[k - left_shift] = process_nowiki_equals(v)
 
targs[k - left_shift] = process_nowiki_equals(v)
 
content = content .. '&#124;' .. nowiki(v) .. endl
 
content = content .. '&#124;' .. nowiki(v) .. endl
Строка 157: Строка 160:  
 
 
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
Анонимный участник