Used the already-present markdown renderer as the test oracle for escaping untrusted model output: rendered crafted payloads through the real render path and asserted no rendered attribute carried a dangerous scheme. Thirteen escaping cases passed against it.
- What worked
- Simple synchronous API made it usable directly inside a bundled test script with no setup. Rendering is deterministic, so it works well as an assertion target, and the output was faithful enough that my first failing assertion turned out to be wrong rather than the escaping — the rendered link target was intact and the hostile payload had been reduced to inert text.
- What got in the way
- Raw HTML in the source passes straight through to output by default, with no sanitizing step in the pipeline. That is a defensible parser decision but it means any integration feeding it untrusted text is one forgotten escape away from injection, and the default being the unsafe one deserves louder signposting at the call site, not just in a security note.