From 9c81c24fbe4194f8bfb532ea33951abc86f38b6e Mon Sep 17 00:00:00 2001 From: Flrande <1978616327@qq.com> Date: Thu, 29 May 2025 14:37:41 +0000 Subject: [PATCH] fix(editor): clear selection after toggle latex editor (#12637) - **fix(editor): clear selection after toggle latex editor** - **chore: remove useless test** ## Summary by CodeRabbit - **New Features** - LaTeX rendering now outputs MathML format for improved accessibility and compatibility. - Added support for KaTeX styling to enhance LaTeX display in the playground. - **Bug Fixes** - Improved editor behavior by resetting the selection group before opening the LaTeX editor. --- blocksuite/affine/inlines/latex/src/latex-node/latex-node.ts | 2 ++ blocksuite/playground/package.json | 1 + blocksuite/playground/style.css | 2 ++ yarn.lock | 1 + 4 files changed, 6 insertions(+) diff --git a/blocksuite/affine/inlines/latex/src/latex-node/latex-node.ts b/blocksuite/affine/inlines/latex/src/latex-node/latex-node.ts index 1bd35baf3a..5ddcd8833f 100644 --- a/blocksuite/affine/inlines/latex/src/latex-node/latex-node.ts +++ b/blocksuite/affine/inlines/latex/src/latex-node/latex-node.ts @@ -188,6 +188,8 @@ export class AffineLatexNode extends SignalWatcher( this._editorAbortController?.abort(); this._editorAbortController = new AbortController(); + blockComponent.selection.setGroup('note', []); + const portal = createLitPortal({ template: html`