Module:Lorebook: Difference between revisions

No edit summary
Escape curly braces ({/}) and wrap output in pre tag to prevent template invocation
Line 202: Line 202:
   local result = buildInjection(rows, triggered)
   local result = buildInjection(rows, triggered)
    
    
   -- Wrap result in <nowiki><pre> to preserve formatting and prevent wiki parsing
   -- Escape curly braces to prevent template/parser function invocation
  -- and wrap in <pre> tag to preserve formatting
   if result and result ~= '' then
   if result and result ~= '' then
     return '<nowiki><pre>' .. result .. '</pre></nowiki>'
    result = result:gsub('{', '&#123;'):gsub('}', '&#125;')
     return '<pre>' .. result .. '</pre>'
   else
   else
     return ''
     return ''