4 months ago
d290f28Multiple `---` separators in an assistant message all collided on the React key `paragraph:---` because the block list keyed by truncated content. The same applied to any repeated short paragraph. The result was a flood of "Encountered two children with the same key" warnings from MarkdownText. Recognize `---`, `***`, and `___` (3+ chars, optional spaces) on their own line as horizontal-rule blocks and render them as a thin separator, matching how every other markdown renderer treats them. Key the blocks loop by index so any future content collision can't duplicate keys. Move the pure parsing logic into markdownParser.ts so it can be exercised by bun tests without dragging React Native imports through the test runner. The view module re-exports the parser surface for any existing imports. Co-authored-by: Cursor <cursoragent@cursor.com>
Parent14b7e0a