Content deleted Content added
numbers |
if abbreviation is uppercase, display as small caps |
||
Line 37:
local args = frame:getParent().args[1] and frame:getParent().args or frame.args
local abbreviation = args[1] or error("Provide an abbreviation in parameter 1")
local key = string.gsub(abbreviation, "%.$", "")
key = string.lower(key)
local expanded = data[key] or error("The abbreviation "..(abbreviation or "nil").." is not recognized")
return '<abbr title="'..expanded..'">'..abbreviation..'</abbr>'▼
local _, count = mw.ustring.gsub(abbreviation, "%u", "")
if count > #abbreviation * 3/4 then
return '<abbr class="smallcaps" style="font-variant: small-caps; text-transform: lowercase;" title="'..expanded..'">'..abbreviation..'</abbr>'
else
end
end
|