File tree Expand file tree Collapse file tree 2 files changed +13
-4
lines changed
blocks/ParagraphBlockContent Expand file tree Collapse file tree 2 files changed +13
-4
lines changed Original file line number Diff line number Diff line change 44} from "../../schema" ;
55import { createDefaultBlockDOMOutputSpec } from "../defaultBlockHelpers" ;
66import { defaultProps } from "../defaultProps" ;
7+ import { handleEnter } from "../ListItemBlockContent/ListItemKeyboardShortcuts" ;
78
89export const paragraphPropSchema = {
910 ...defaultProps ,
@@ -13,6 +14,18 @@ export const ParagraphBlockContent = createStronglyTypedTiptapNode({
1314 name : "paragraph" ,
1415 content : "inline*" ,
1516 group : "blockContent" ,
17+
18+ addKeyboardShortcuts ( ) {
19+ return {
20+ Enter : ( ) => handleEnter ( this . editor ) ,
21+ "Mod-Alt-0" : ( ) =>
22+ this . editor . commands . BNUpdateBlock ( this . editor . state . selection . anchor , {
23+ type : "paragraph" ,
24+ props : { } ,
25+ } ) ,
26+ } ;
27+ } ,
28+
1629 parseHTML ( ) {
1730 return [
1831 { tag : "div[data-content-type=" + this . name + "]" } ,
Original file line number Diff line number Diff line change @@ -693,10 +693,6 @@ export const BlockContainer = Node.create<{
693693 this . editor . commands . liftListItem ( "blockContainer" ) ;
694694 return true ;
695695 } ,
696- "Mod-Alt-0" : ( ) =>
697- this . editor . commands . BNCreateBlock (
698- this . editor . state . selection . anchor + 2
699- ) ,
700696 } ;
701697 } ,
702698} ) ;
You can’t perform that action at this time.
0 commit comments