// MarkdownPreview.jsx — Phase 2 of the Contribute rewrite. The rendered // preview pane that replaces Tiptap's read-only render for Discuss mode // and sits next to the CM6 raw pane in Contribute mode. // // Two responsibilities: // • Markdown → HTML via marked, with ```mermaid fences extracted to // placeholder nodes that resolve once mermaid lazy-loads. // • Window-selection bridge per §8.12 — onMouseUp inside the preview // reports {text, coords} to the parent so the SelectionTooltip can // anchor against the rendered DOM (no PM/Tiptap surface here). // // Mermaid lazy-load: triggered on the first appearance of a ```mermaid // fence in any rendered doc, not on mount. The module (~200 KB gzipped) // stays out of the main bundle. `securityLevel: 'strict'` neutralizes // hostile