Content deleted Content added
mNo edit summary |
m rowspan |
||
Line 95:
'\n!', style['header rightcell'], 'Following station'
}))
table.insert(t, '')
table.insert(t, '')
table.insert(t, '')
end
Line 146 ⟶ 149:
table.insert(t, '\n|-\n|')
table.insert(t, table.concat({style['body leftcell'], left[v], leftTerminus[v], '\n|'}))
table.insert(t, table.concat({style['body banner'], colour[v], '"| ',
table.insert(t, table.concat({style['body rightcell'], right[v], rightTerminus[v]}))
end
end
local function combine(t, i)
if t[i+4] ~= '' and t[i+4] == t[i] then
local tmp = i+4
t[i+4] = ''
local rowspan = 2
while t[tmp] ~= t[tmp+4] do
t[tmp+4] = ''
rowspan = rowspan+1
tmp = tmp+4
end
t[i] = mw.ustring.gsub(t[i], '\n|style="', table.concat({'\n|rowspan="', rowspan, '" style="'}))
end
end
local max = #t
for i = 2, max-2, 4 do combine(t, i) end
for i = 3, max-1, 4 do combine(t, i) end
for i = 4, max, 4 do combine(t, i) end
return table.concat(t)
|