FANDOM


local k = {}
 
function k.load( frame )
    local tArgs = frame.getParent()
    local name = tArgs.args[1]
    if not(name) then
        return ""
    end
    if name == "" then
        return ""
    end
    local schemaPage = mw.title.new( name , "Schema") or mw.title.new("Schema:"..name, "")
    if not(schemaPage) then
        return ""
    end
    local content = schemaPage.getContent()
    if not(content) then
        return ""
    end
    decoded = mw.text.jsonDecode(content)
    --I haven't figured out how to block injection attacks here yet. I'm not familiar with Lua, and the json API I'm using is poorly documented. 
    local injection = "<span style=\"display:none\"><script type=\"application/ld+json\">" .. content .. "</script></span>"
    return injection
end
return k

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.