local ongoing = rargs.ongoing == 'yes'
local output = {'|-'}
setmetatable(output{'|-'}, {__call = function (t, v) t[#t+1] = v end }) -- Append to array by calling it
local function threeCells(cellType, title, always, shortname)
-- Subset of Template:Succession links --
function p._successionlinks(sargs)
local output = setmetatable({}, {__call = function (t, v) t[#t+1] = v end })-- Append to table by calling it
local output = {}
local dqhm = function (s) return require('Module:MultiReplace').main({s, '%[%[ *([%?-]) *%]%]', '%1', '%[%[ *[%?-] *| *(.-) *%]%]','%1'}) end
if notblank(sargs.center) then
table.insert(output, ('<table style="width:100%; margin:1px; display:inline-table;"><tr>')
table.insert(output, ('<td style="text-align:left; vertical-align:middle; padding:0 0.5em 0 0;' .. (sargs.leftstyle or '') .. '" class = "noprint">')
table.insert(output, ((notblank(sargs.left) and ('← ' .. dqhm(sargs.left or '')) or '') .. '</td>')
table.insert(output, ('<td style="text-align:center; vertical-align:middle; padding:0 1px;' .. (sargs.centerstyle or '') .. '">')
table.insert(output, (sargs.center .. '</td>')
table.insert(output, ('<td style="text-align:right; vertical-align:middle; padding:0 0 0 0.5em;' .. (sargs.rightstyle or '') .. '" class="noprint">')
table.insert(output, ((notblank(sargs.right) and (dqhm(sargs.right or '') .. ' →') or '') .. '</td>')
table.insert(output, ('</tr></table>')
elseif notblank(sargs.left) or notblank(sargs.right) then
table.insert(output, ('<div style="width:100%">')
if notblank(sargs.left) then
table.insert(output, ('<div style="float: left; text-align:left;padding-right:0.5em;' .. (sargs.leftstyle or '') .. ' class="noprint">')
table.insert(output, ('← ' .. dqhm(sargs.left or '') .. '</div>')
end
if notblank(sargs.right) then
table.insert(output, ('<div style="float: right; text-align:right;padding-left:0.5em;' .. (sargs.rightstyle or '') .. ' class="noprint">')
table.insert(output, (dqhm(sargs.right or '') .. ' →</div>')
end
table.insertoutput('</div>')
end
return table.concat(output, '\n')
|