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 |
Escape curly braces ({/}) in debug output to prevent template invocation |
||
| (One intermediate revision by the same user not shown) | |||
| 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 | ||
-- | -- Escape curly braces and use <pre> tag to preserve formatting | ||
if result and result ~= '' then | if result and result ~= '' then | ||
output = output | result = result:gsub('{', '{'):gsub('}', '}') | ||
output = output .. result .. '\n</pre>\n' | |||
else | else | ||
output = output .. "(empty output)\n" | output = output .. "(empty output)\n</pre>\n" | ||
end | end | ||