Documentation for this module may be created at Module:ModuleLevelTable/doc
local p = {}
function p.loadJson(frame)
-- Get the JSON string from the template parameter named 'json'
local jsonString = frame.args.json
-- Parse the JSON string into a Lua table
local success, jsonTable = pcall(mw.text.jsonDecode, jsonString)
if success then
return jsonTable
else
return "Error parsing JSON"
end
end
return p