Skip to content

Commit

Permalink
fix: markdown shortcuts removes existing block (#336)
Browse files Browse the repository at this point in the history
  • Loading branch information
mdsaban authored Oct 5, 2024
1 parent b87bc54 commit 29ff620
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions packages/core/editor/src/extensions/shortcuts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export const withShortcuts = (editor: YooEditor, slate: SlateEditor) => {
if (hasMatchedBlock && !matchedBlock.isActive()) {
Transforms.select(slate, range);
Transforms.delete(slate);
editor.blocks[matchedBlock.type].toggle({ focus: true });
Blocks.createBlock(editor, matchedBlock.type, { deleteText: false, focus: true });
return;
}
Expand Down

0 comments on commit 29ff620

Please sign in to comment.