Changes

Jump to navigation Jump to search
tweak printAttribute usage
Line 301: Line 301:  
-- Print an HTML attribute (like key="value") if a non-empty value is specified. This is a temporary method during the migration to Lua.
 
-- Print an HTML attribute (like key="value") if a non-empty value is specified. This is a temporary method during the migration to Lua.
 
-- @param frame The arguments passed to the script.
 
-- @param frame The arguments passed to the script.
-- @test mw.log(p.printAttribute({ args = { key="someKey", value="some \"'<> value" }}))
+
-- @test mw.log(p.printAttribute({ args = { "someKey", "some \"'<> value" }}))
 
function p.printAttribute(frame)
 
function p.printAttribute(frame)
   local key = frame.args["key"]
+
   local key = frame.args[1]
   local value = frame.args["value"]
+
   local value = frame.args[2]
    
   if value == nil or value == "" then
 
   if value == nil or value == "" then
translators
8,445

edits

Navigation menu