Module:Template input utils: Difference between revisions
to-table functions remove original values from args table; this is now toggleable |
m minor refactoring for numbered-arg-to-table functions; keep_originals is the 3rd arg; shouldn't affect the modules calling the functions |
||
| Line 13: | Line 13: | ||
-- table, as it may require further processing (EG, parsing to number, ratio, | -- table, as it may require further processing (EG, parsing to number, ratio, | ||
-- kv-pairs, etc). | -- kv-pairs, etc). | ||
function p.numbered_args_to_table(args, max_num, key_fmt | function p.numbered_args_to_table(args, max_num, keep_originals, key_fmt) | ||
local max_num = max_num or 100 | local max_num = max_num or 100 | ||
local key_fmt = key_fmt or "Entry %d" | local key_fmt = key_fmt or "Entry %d" | ||
| Line 38: | Line 38: | ||
-- table, as it may require further processing (EG, parsing to number, ratio, | -- table, as it may require further processing (EG, parsing to number, ratio, | ||
-- kv-pairs, etc). | -- kv-pairs, etc). | ||
function p.numbered_header_data_args_to_table(args, max_num, header_fmt, data_fmt | function p.numbered_header_data_args_to_table(args, max_num, keep_originals, is_strict_pair, header_fmt, data_fmt) | ||
local max_num = max_num or 100 | local max_num = max_num or 100 | ||
local header_fmt = header_fmt or "Header %d" | local header_fmt = header_fmt or "Header %d" | ||