diff --git a/packages/core/src/blocks/ParagraphBlockContent/ParagraphBlockContent.ts b/packages/core/src/blocks/ParagraphBlockContent/ParagraphBlockContent.ts index fcb532a8af..07425c77de 100644 --- a/packages/core/src/blocks/ParagraphBlockContent/ParagraphBlockContent.ts +++ b/packages/core/src/blocks/ParagraphBlockContent/ParagraphBlockContent.ts @@ -4,6 +4,7 @@ import { } from "../../schema"; import { createDefaultBlockDOMOutputSpec } from "../defaultBlockHelpers"; import { defaultProps } from "../defaultProps"; +import { handleEnter } from "../ListItemBlockContent/ListItemKeyboardShortcuts"; export const paragraphPropSchema = { ...defaultProps, @@ -13,6 +14,18 @@ export const ParagraphBlockContent = createStronglyTypedTiptapNode({ name: "paragraph", content: "inline*", group: "blockContent", + + addKeyboardShortcuts() { + return { + Enter: () => handleEnter(this.editor), + "Mod-Alt-0": () => + this.editor.commands.BNUpdateBlock(this.editor.state.selection.anchor, { + type: "paragraph", + props: {}, + }), + }; + }, + parseHTML() { return [ { tag: "div[data-content-type=" + this.name + "]" }, diff --git a/packages/core/src/pm-nodes/BlockContainer.ts b/packages/core/src/pm-nodes/BlockContainer.ts index d7aab2b0e6..77e3e3dab8 100644 --- a/packages/core/src/pm-nodes/BlockContainer.ts +++ b/packages/core/src/pm-nodes/BlockContainer.ts @@ -693,10 +693,6 @@ export const BlockContainer = Node.create<{ this.editor.commands.liftListItem("blockContainer"); return true; }, - "Mod-Alt-0": () => - this.editor.commands.BNCreateBlock( - this.editor.state.selection.anchor + 2 - ), }; }, });