Module:Lorebook/Debug: Difference between revisions

Fix mw.smw.ask syntax (use array format), improve containsAny pattern matching, add nowiki wrapping, improve newline formatting, enhance debugging output
Replace nowiki with pre tag for proper MediaWiki rendering in debug output
Line 288: Line 288:
       output = output .. "* " .. t .. "\n"
       output = output .. "* " .. t .. "\n"
     end
     end
     output = output .. "\n'''=== Output ==='''\n"
     output = output .. "\n'''=== Output ==='''\n<pre>\n"
   end
   end
    
    
   -- Wrap result in <nowiki> to preserve formatting and prevent wiki parsing
   -- Use <pre> tag to preserve formatting and prevent wiki parsing in debug mode
   if result and result ~= '' then
   if result and result ~= '' then
     output = output .. '<nowiki>\n' .. result .. '\n</nowiki>\n'
     output = output .. result .. '\n</pre>\n'
   else
   else
     output = output .. "(empty output)\n"
     output = output .. "(empty output)\n</pre>\n"
   end
   end