Module:Infobox: Difference between revisions
add tiu module |
try to bugfix |
||
| Line 69: | Line 69: | ||
local data = row_content["Data" ] | local data = row_content["Data" ] | ||
if | if header and data then | ||
local lines = {} | local lines = {} | ||
table.insert(lines, '|-') | table.insert(lines, '|-') | ||
| Line 76: | Line 76: | ||
return table.concat(lines, "\n") | return table.concat(lines, "\n") | ||
elseif | elseif header and not data then | ||
local lines = {} | local lines = {} | ||
table.insert(lines, '|-') | table.insert(lines, '|-') | ||
table.insert(lines, '| colspan="2" style="text-align: center;" | ' .. | table.insert(lines, '| colspan="2" style="text-align: center;" | ' .. header) | ||
return table.concat(lines, "\n") | return table.concat(lines, "\n") | ||
| Line 253: | Line 253: | ||
-- Helper function; preprocess infobox rows from old format to new format | -- Helper function; preprocess infobox rows from old format to new format | ||
-- One-element entries are interpreted as dataless headers, as it already is. | |||
function p.preprocess_entries(entries) | function p.preprocess_entries(entries) | ||
local processed = {} | local processed = {} | ||