Module:JSON

local p = {}

local escapes = { ['['] = '&#91;',	[']'] = '&#93;',	['{'] = '&#123;',	['|'] = '&#124;',	['}'] = '&#125;', }

function p.wikiescapes(s) s = mw.text.split(s,'') local ret = {} for _, v in ipairs(s) do		table.insert(ret,escapes[v] or v)	end

return table.concat(ret) end

return p