mirror of
https://github.com/multica-ai/multica.git
synced 2026-07-05 21:39:54 +02:00
react-native-enriched-markdown does not expose JS-level custom renderers (issues #54, #232, #246), so syntax highlighting, tap-to-lightbox, and copy buttons cannot live inside enriched. Maintainer-endorsed workaround (#246): split markdown at those boundaries and render the leaves in React. splitMarkdown walks marked.lexer tokens and emits prose / code / image segments. Each prose island gets its own EnrichedMarkdownText; code blocks reuse the in-house CodeBlock (Shiki + copy + horizontal scroll); images reuse MarkdownImage (expo-image + lightbox). Paragraph-embedded images are promoted to block siblings, matching GitHub mobile and Linear iOS. Drops ~600 LOC of dead walker code (render-block, render-inline, ast, link, mention-chip, key) that the previous engine swap left behind. Visual polish for the hybrid output: - inline code alpha 20% → 12%; enriched paints over the full line height and RN can't apply the padding/radius/0.85em that keep GitHub web's chip compact, so the web alpha reads too heavy here. - new `code-surface` token (#e8e8eb), one step darker than `secondary`, plus a 1px `border-border` hairline. Code block now elevates inside both white issue bodies and grey comment cards. - code block margin my-3 — breathing room both sides. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>