Module:Test lua: Difference between revisions
Jump to navigation
Jump to search
Created page with "local p = {} function p.fn(frame) local origArgs = (type(frame.getParent) == "function") and frame:getParent().args or frame local success, json = pcall(mw.text.jsonDecode, origArgs[0]) local ret = mw.visualdata.query( "Test class", "class::+" ) return mw.dumpObject(ret) -- return '<pre>' .. mw.dumpObject(json) .. '</pre>' end -- =p.fn({"add\ndfdd","b","c","text"}) return p" |
No edit summary |
||
Line 6: | Line 6: | ||
local ret = mw.visualdata.query( " | local ret = mw.visualdata.query( "School class", "[[class::+]]" ) | ||
Latest revision as of 09:38, 20 August 2024
Documentation for this module may be created at Module:Test lua/doc
local p = {}
function p.fn(frame)
local origArgs = (type(frame.getParent) == "function") and frame:getParent().args or frame
local success, json = pcall(mw.text.jsonDecode, origArgs[0])
local ret = mw.visualdata.query( "School class", "[[class::+]]" )
return mw.dumpObject(ret)
-- return '<pre>' .. mw.dumpObject(json) .. '</pre>'
end
-- =p.fn({"add\ndfdd","b","c","text"})
return p