Module:Sandbox/Aidan9382: Difference between revisions

Content deleted Content added
dump function cause i wanna see inside table
fix format and add tag stuff cause i forgot about that (this probably wont work first try but eh
Line 20:
--Represent the key (we dont expand table keys)
if type(a) == "string" then
result = result .. "\""..a.."\": "
else
result = result .. ""..tostring(a)..": "
end
result = result .. ": "
--Represent the value
if type(b) == "string" then
Line 32 ⟶ 33:
elseif recursion[b] then
result = result .. tostring(b) .. "[ Recursion ]"
else --Dump the table inside
recursion[b] = true
result = result .. Dump(b,depth-1,result,indent+2,recursion)
end
elseif type(b) == "nil" then
result = result .. "nil"
else
result = result .. tostring(b)
Line 45 ⟶ 48:
end
function functions:RawInfo()
return mw.html.create("<syntaxhighlight lang=text>\n"..):wikitext(Dump(self,5).."\n</syntaxhighlight>")
end