Wowpedia
Wowpedia
229,594
pages
 
(4 intermediate revisions by the same user not shown)
Line 5: Line 5:
 
local color = args["color"] or "orange"
 
local color = args["color"] or "orange"
 
local icon = args["icon"] or "stub.png"
 
local icon = args["icon"] or "stub.png"
  +
local iconstyle = args["iconstyle"] or "padding: 10px 5px;"
local innerdiv = string.gsub(string.gsub(string.gsub(string.gsub(f:preprocess(args["innerdiv"]),"<","&lt;"),">","&gt;"),"'","\\'"),' ','_')
 
  +
local innerdiv = mw.text.nowiki(f:preprocess(args["innerdiv"]))
local output = "<div class='amdiv amdiv-" .. color .."'><div class='amdiv-image'>[[File:"..icon.."|x30px|"..args["icontext"].."|link="..args["iconlink"].."]]</div><div class='amdiv-text' data-value='"..innerdiv.."'></div></div>"
+
local output = "<div class='amdiv amdiv-" .. color .."'><div class='amdiv-image' style='"..iconstyle.."'>[[File:"..icon.."|x30px|"..args["icontext"].."|link="..args["iconlink"].."]]</div><div class='amdiv-text' data-value='"..innerdiv.."'></div></div>"
 
return output
 
return output
 
end
 
end

Latest revision as of 21:39, 10 October 2019

Documentation for this module may be created at Module:Amdiv/doc

local p = {}

p.main = function(f) 
	local args = f:getParent().args
	local color = args["color"] or "orange"
	local icon = args["icon"] or "stub.png"
	local iconstyle = args["iconstyle"] or "padding: 10px 5px;"
	local innerdiv = mw.text.nowiki(f:preprocess(args["innerdiv"]))
	local output = "<div class='amdiv amdiv-" .. color .."'><div class='amdiv-image' style='"..iconstyle.."'>[[File:"..icon.."|x30px|"..args["icontext"].."|link="..args["iconlink"].."]]</div><div class='amdiv-text' data-value='"..innerdiv.."'></div></div>"
	return output
end

return p