Module:Scale tree: Difference between revisions

Ganaram inukshuk (talk | contribs)
No edit summary
Ganaram inukshuk (talk | contribs)
Entries for the scale tree are now trimmed of extra spaces, so delimiters may have spaces before and after
Line 12: Line 12:
local parsed = {}
local parsed = {}
for entry in string.gmatch(unparsed, '([^;]+)') do
for entry in string.gmatch(unparsed, '([^;]+)') do
table.insert(parsed, entry) -- Add to array
local trimmed = entry:gsub("^%s*(.-)%s*$", "%1")
table.insert(parsed, trimmed) -- Add to array
end
end
return parsed
return parsed
Line 22: Line 23:
local parsed = {}
local parsed = {}
for entry in string.gmatch(unparsed, '([^:]+)') do
for entry in string.gmatch(unparsed, '([^:]+)') do
table.insert(parsed, entry) -- Add to array
local trimmed = entry:gsub("^%s*(.-)%s*$", "%1")
table.insert(parsed, trimmed) -- Add to array
end
end
if #parsed == 2 then
if #parsed == 2 then