Module:Lorebook/Debug: Difference between revisions
Fix mw.smw.ask usage - use array format with printouts as '?Property=label' |
Fix mw.smw.ask syntax (use array format), improve containsAny pattern matching, add nowiki wrapping, improve newline formatting, enhance debugging output |
||
Line 204: | Line 204: | ||
end | end | ||
if #chatChunks > 0 then | if #chatChunks > 0 then | ||
if #plistChunks > 0 then | |||
text = text .. '\n' -- Add extra newline between plist and chat sections | |||
end | |||
text = text .. table.concat(chatChunks, '\n') | text = text .. table.concat(chatChunks, '\n') | ||
end | end | ||
Line 285: | Line 288: | ||
output = output .. "* " .. t .. "\n" | output = output .. "* " .. t .. "\n" | ||
end | end | ||
output = output .. "\n'''=== Output ===''' | output = output .. "\n'''=== Output ==='''\n" | ||
end | end | ||
-- Wrap result in <nowiki> to preserve formatting and prevent wiki parsing | |||
if result and result ~= '' then | |||
if | output = output .. '<nowiki>\n' .. result .. '\n</nowiki>\n' | ||
output = output .. | else | ||
output = output .. "(empty output)\n" | |||
end | end | ||