Jump to content

Module:LoadData and Module:LoadData/sandbox: Difference between pages

(Difference between pages)
Page 1
Page 2
Content deleted Content added
m Protected "Module:LoadData": High-risk template or module: 398 transclusions (more info) ([Edit=Require autoconfirmed or confirmed access] (indefinite))
 
Create sandbox version of Module:LoadData
 
Line 55: Line 55:
__index = function(t, k)
__index = function(t, k)
return function(frame)
return function(frame)
if k:sub(-5) == '.json' then
return load('Module:' .. k, frame)
return load(mw.text.jsonDecode(mw.title.new(k).getContent()), frame)
end
else
return load(mw.loadData('Module:' .. k), frame)
end
end
end
end
})
})