Module:Lorebook: Difference between revisions

Escape curly braces ({/}) and wrap output in pre tag to prevent template invocation
m Protected "Module:Lorebook" ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite))
 
(3 intermediate revisions by the same user not shown)
Line 205: Line 205:
   -- and wrap in <pre> tag to preserve formatting
   -- and wrap in <pre> tag to preserve formatting
   if result and result ~= '' then
   if result and result ~= '' then
     result = result:gsub('{', '&#123;'):gsub('}', '&#125;')
     result = result:gsub('{{', '<nowiki>{{</nowiki>'):gsub('}}', '<nowiki>}}</nowiki>')
     return '<pre>' .. result .. '</pre>'
     return '<pre>' .. result .. '</pre>'
   else
   else