Module:nyms: Difference between revisions

Jump to navigation Jump to search
ਕੋਈ ਸੋਧ ਸਾਰ ਨਹੀਂ
(Added sorting)
No edit summary
 
Line 28: Line 28:
)
)
end
end
table.sort(links, function(a, b) return a.term < b.term end)
table.sort(links, function(a, b) return a < b 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