Module:MOS gamut: Difference between revisions
Gamut function now accepts the full UDP; this will momentarily break the mos degrees module/template |
Using the pipe character directly has a few issues in the visual editor, so an alternative symbol is advised |
||
| Line 123: | Line 123: | ||
end | end | ||
-- Helper function for parsing a UDP entered as a string "up| | -- Helper function for parsing a UDP entered as a string "up-dp" | ||
-- To avoid potential issues, the "-" character is used instead of "|" | |||
function p.parse_udp(step_ratio_unparsed) | function p.parse_udp(step_ratio_unparsed) | ||
local parsed = {} | local parsed = {} | ||
for entry in string.gmatch(step_ratio_unparsed, '([^ | for entry in string.gmatch(step_ratio_unparsed, '([^-]+)') do | ||
local trimmed = entry:gsub("^%s*(.-)%s*$", "%1") | local trimmed = entry:gsub("^%s*(.-)%s*$", "%1") | ||
table.insert(parsed, trimmed) -- Add to array | table.insert(parsed, trimmed) -- Add to array | ||