Module:Related topics category

local p = {}

local parents = { ["Latin America"] = 0, ["Brazil"] = "Latin America", ["Europe"] = 0, ["United Kingdom"] = "Europe", ["Havering"] = "United Kingdom" }

local function getCategoryTree(node) local tree = {}

while node and parents[node] do       table.insert(tree, "") node = parents[node] end

return table.concat(tree, "") end

function p.getCategoryTree(frame) local input = frame local tree = getCategoryTree(input) return tree end

return p