Skip to content

Commit 0de5cc1

Browse files
committed
fix tests
1 parent ef76143 commit 0de5cc1

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/lexical-markdown/src/MarkdownShortcuts.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -498,14 +498,18 @@ export function registerMarkdownShortcuts(
498498
const anchorNode = editorState._nodeMap.get(anchorKey);
499499

500500
if (
501-
!canContainTransformableMarkdown(anchorNode) ||
501+
!$isTextNode(anchorNode) ||
502502
!dirtyLeaves.has(anchorKey) ||
503503
(anchorOffset !== 1 && anchorOffset > prevSelection.anchor.offset + 1)
504504
) {
505505
return;
506506
}
507507

508508
editor.update(() => {
509+
if (!canContainTransformableMarkdown(anchorNode)) {
510+
return;
511+
}
512+
509513
const parentNode = anchorNode.getParent();
510514

511515
if (parentNode === null || $isCodeNode(parentNode)) {

0 commit comments

Comments
 (0)