Module:Infobox chord: Difference between revisions
ArrowHead294 (talk | contribs) mNo edit summary |
added a way to enter color names |
||
| Line 34: | Line 34: | ||
name, | name, | ||
}) | }) | ||
end | |||
local colour_name = frame.args["Color name"] | |||
if utils.value_provided(colour_name) then | |||
local caption = "[[Color notation|Color name]]" | |||
-- search for ", " not "," because many chord names contain commas, e.g. Cz,y6 | |||
if name:match(", ") then | |||
caption = "[[Color notation|Color names]]" | |||
-- removing manual line breaks | |||
local matches | |||
name, matches = name:gsub("<br%s?/?>", "") | |||
if matches > 0 then | |||
cats = cats .. "[[Category:Todo:remove manual line breaks]]" | |||
end | |||
-- replacing commas+whitespaces with line breaks | |||
name = name:gsub(",%s+", "<br />") | |||
end | |||
table.insert(infobox_data, { | |||
caption, | |||
colour_name, | |||
}) | |||
else | |||
cats = cats .. "[[Category:Todo:add color name]]" | |||
end | end | ||