Module:Infobox chord: Difference between revisions

Bcmills (talk | contribs)
Add Todo category for finding chords with the deprecated Name parameter
Bcmills (talk | contribs)
Remove the (now unused) Name parameter.
Line 14: Line 14:
local cats = ""
local cats = ""


local name = frame.args["Name"]
if utils.value_provided(name) then
local caption = "Name"
if name:match(",") then
caption = "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
-- removing whitespaces after commas
name = name:gsub(",%s+", ",")
-- placing line breaks after commas
name = name:gsub(",", ",<br />")
end
table.insert(infobox_data, {
caption,
name,
})
    cats = cats .. "[[Category:Todo:remove deprecated chord name]]"
end
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