Module:Infobox chord: Difference between revisions
mNo edit summary |
bug fix |
||
Line 40: | Line 40: | ||
local caption2 = "[[Color notation|Color name]]" | local caption2 = "[[Color notation|Color name]]" | ||
-- search for ", " not "," because many chord names contain commas, e.g. Cz,y6 | -- search for ", " not "," because many chord names contain commas, e.g. Cz,y6 | ||
if | if color_name:match(", ") then | ||
caption2 = "[[Color notation|Color names]]" | caption2 = "[[Color notation|Color names]]" | ||
-- removing manual line breaks | -- removing manual line breaks | ||
local matches | local matches | ||
color_name, matches = color_name:gsub("<br%s?/?>", "") | |||
if matches > 0 then | if matches > 0 then | ||
cats = cats .. "[[Category:Todo:remove manual line breaks]]" | cats = cats .. "[[Category:Todo:remove manual line breaks]]" | ||
end | end | ||
-- replacing every comma+whitespace(s) instance with a line break | -- replacing every comma+whitespace(s) instance with a line break | ||
color_name = color_name:gsub(",%s+", "<br />") | |||
end | end | ||
table.insert(infobox_data, { | table.insert(infobox_data, { |