Module:Infobox chord: Difference between revisions

TallKite (talk | contribs)
mNo edit summary
TallKite (talk | contribs)
mNo edit summary
Line 38: Line 38:
local color_name = frame.args["ColorName"]
local color_name = frame.args["ColorName"]
if utils.value_provided(color_name) then
if utils.value_provided(color_name) then
local caption = "[[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 name:match(", ") then
if name:match(", ") then
caption = "[[Color notation|Color names]]"
caption2 = "[[Color notation|Color names]]"
-- removing manual line breaks
-- removing manual line breaks
local matches
local matches
Line 48: Line 48:
cats = cats .. "[[Category:Todo:remove manual line breaks]]"
cats = cats .. "[[Category:Todo:remove manual line breaks]]"
end
end
-- replacing commas+whitespaces with line breaks
-- replacing every comma+whitespace(s) instance with a line break
name = name:gsub(",%s+", "<br />")
name = name:gsub(",%s+", "<br />")
end
end
table.insert(infobox_data, {
table.insert(infobox_data, {
caption,
caption2,
color_name,
color_name,
})
})