mirror of
https://github.com/bytedance/deer-flow.git
synced 2026-10-26 13:16:24 +00:00
CommonMark forbids an info string on a closing fence, so "```python" inside a plain ``` fence is content, not the end of the block. The closer check that two fence consumers share only compared character and run length, which ends the block early and pushes whatever follows back into prose: on the render path a system marker inside the sample loses its tags and its content becomes visible text, and on the export path stripInternalMarkers deletes real user content from the thread markdown. mermaid.ts already had the correct predicate privately. Move it into the shared leaf module and use it from both consumers, so the three fence scanners in core/streamdown and core/messages agree on what closes a block.