Module:Sandbox/Erutuon/Glossing abbreviations: Difference between revisions

Content deleted Content added
attempt to create a module for simply creating abbr tags for glossing abbreviations
 
allow parent arguments
Line 11:
 
function p.abbr(frame)
local abbreviationparent = frame:getParent().args[1] orand errorframe:getParent("Provide an abbreviation in parameter 1").args
local abbreviation = frame.args[1] or parent.args[1] error("Provide an abbreviation in parameter 1")
local expanded = data[abbreviation] or error("The abbreviation "..(abbreviation or "nil").." is not recognized")
return '<abbr title="'..expanded..'">'..abbreviation..'</abbr>'