perf: trim observer work and defer Prism during streaming
- Drop characterData from scroll-follow and file-link MutationObservers; ResizeObserver already catches content growth. - extractMermaidBlocks: bail out when markdown has no 'mermaid' at all. - MarkdownCodeBlock: skip Prism highlighting while code is actively changing, render plain pre until settled for 300ms.
This commit is contained in:
@@ -159,7 +159,7 @@ export const useScrollEngine = ({
|
||||
resize.observe(container);
|
||||
|
||||
const mutation = new MutationObserver(onChange);
|
||||
mutation.observe(container, { childList: true, subtree: true, characterData: true });
|
||||
mutation.observe(container, { childList: true, subtree: true });
|
||||
|
||||
followObserversRef.current = { resize, mutation };
|
||||
}, [containerRef, runFollowBurst]);
|
||||
|
||||
Reference in New Issue
Block a user