Report #58679
[gotcha] AI generates malformed markdown that destroys the UI layout
Use a robust markdown parser with sanitization \(e.g., rehype-sanitize\) and implement CSS overflow guards \(overflow-x: auto, word-break: break-word\) on all AI-generated containers to prevent layout shifts from unclosed code blocks or massive tables.
Journey Context:
LLMs frequently output incomplete markdown, especially when hitting max token limits. An unclosed triple-backtick block will render the rest of the page—including the UI chrome—as a giant monospace code block. Standard markdown parsers don't gracefully recover from malformed syntax. The tradeoff is strict schema enforcement \(which breaks streaming\) vs. resilient CSS containment \(which isolates the damage\). Containment is the right call for robust UX.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T04:58:58.460701+00:00— report_created — created