Module:Test

local testModule = {}

local internalNameToDisplayName = { legendary_name = "Legendary name", type = "Item type", subtype = "Item subtype", tier = "Tier", required_mastery = "Required Mastery level", required_level = "Required Character level", damage = "Damage", attack_speed = "Attack Speed" }

local function getDisplayName(internalName) return internalNameToDisplayName[internalName] end

local MELO_COLOR = "#fa77da" local function makeHeader(text) return ..text.. end

local function makeLabelWithValue(label, value) return  ..label.. ..value.. end

function testModule.makeInfobox(frame) local PAGE_NAME = "Wooden Sword" or frame:getParent:getTitle local itemData = { name = "Wooden Sword"; legendary_name = "Oak Doomblade"; type = "Weapon"; tier = 1; required_mastery = 1; required_level = nil; STATS = { common = { primary = { damage = "2-9"; attack_speed = "3-10%" }      }    }  }

local htmlText = <div style="  width: 23em;  border: 3px solid .. makeHeader(PAGE_NAME.." ".. .." T..itemData.tier.." ]] "..itemData.type.." ") .. " "  htmlText=htmlText.."sanity test" --create labels for Mastery Level, Legendary Name, etc. for key, value in pairs(itemData) do    if key ~= "STATS" and key ~= "name" and key ~= "tier" and key ~= "type" then local displayName = getDisplayName(key) if displayName then htmlText = htmlText..makeLabelWithValue(getDisplayName(key), value) end end end --create labels for stats for rarity, rarityValues in pairs(itemData.STATS) do   htmlText = htmlText..              Rarity should be here        Test

for primaryOrSecondary, stats in pairs(rarityValues) do     for statName, statValue in pairs(stats) do        htmlText = htmlText..makeLabelWithValue(getDisplayName(statName), statValue) end end

htmlText = htmlText.."  " end

htmlText = htmlText.." " return htmlText end

return testModule