Fixes
Chat messages containing numbered lists failed to render on Foundry v13 (html.querySelector is not a function from any renderChatMessageHTML hook, message never appears).
Root cause: the markdown converter wrapped bulleted lists in <ul> but emitted ordered-list items as bare <li> with no <ol> wrapper. Foundry's chat template root is itself an <li>, and a bare <li> force-closes that ancestor per the HTML parsing spec — splitting the rendered message into an HTMLCollection and crashing every render hook.
- Ordered lists are now wrapped in
<ol class="loremaster-list">(numbering preserved) - New defense-in-depth pass in
ensureBalancedHtmlrescues bare<li>from any source (including raw HTML echoed by the AI), so this class of breakout can't recur - Regression tests added (
tests/message-formatter.test.mjs)
Note: messages already saved in broken form must be deleted and re-asked — stored content is not rewritten.