24,539
ARTICLES
ON THIS WIKI
ON THIS WIKI
Module:Navbox2
Documentation for this module may be created at Module:Navbox2/doc
local p = {}
-- This function converts a string into a table
local function unserialize(s)
-- Replace the delimiter
s = s:gsub("<","{")
s = s:gsub(">","}")
s = s:gsub("|",",")
-- Add quotes
s = s:gsub('=([^=#<>%[%]|{}]+)%s*([},])', '="%1"%2')
s = s:gsub( '([{,])%s*([^"=,#<>%[%]|{}]+)%s*([},])', '%1"%2"%3')
-- Need to repeat as the pattern overlaps for adjacent ones
s = s:gsub( '([{,])%s*([^"=,#<>%[%]|{}]+)%s*([},])', '%1"%2"%3')
local gentables = loadstring('return ' .. s)
return gentables()
end
-- Creates a navbox
function p.navbox(frame)
local content = frame.args.content or ""
local t = unserialize(content)
end
return p
Twitter Feed
Warning: file_get_contents(/srv/common/): failed to open stream: No such file or directory in /var/www/html/skins/MMWiki/SkinMMWiki.php on line 392
Discussion
To discuss the topics on this wiki, you can visit our community forums!