Module:nyms: Difference between revisions

Jump to navigation Jump to search
Added sorting
No edit summary
(Added sorting)
Line 28: Line 28:
)
)
end
end
table.sort(links, function(a, b) return a.term < b.term end)
if #links > 1 then plural = "s" end
if #links > 1 then plural = "s" end
return '<span class="nyms" data-label="' .. data.label .. 's"><span class="nyms-label">' .. data.label:gsub("^%l", string.upper) .. plural .. ':</span> ' .. table.concat(links, ", ") .. '</span>'
return '<span class="nyms" data-label="' .. data.label .. 's"><span class="nyms-label">' .. data.label:gsub("^%l", string.upper) .. plural .. ':</span> ' .. table.concat(links, ", ") .. '</span>'

Navigation menu