File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed
packages/plugins/preset-gfm/src/node/table Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -30,11 +30,9 @@ export const insertTableInputRule = $inputRule(
30
30
)
31
31
return null
32
32
33
- const tableNode = createTable (
34
- ctx ,
35
- Number ( match . groups ?. row ) ,
36
- Number ( match . groups ?. col )
37
- )
33
+ const row = Math . max ( Number ( match . groups ?. row ?? 0 ) , 2 )
34
+
35
+ const tableNode = createTable ( ctx , row , Number ( match . groups ?. col ) )
38
36
const tr = state . tr . replaceRangeWith ( start , end , tableNode )
39
37
return tr
40
38
. setSelection ( TextSelection . create ( tr . doc , start + 3 ) )
@@ -70,7 +68,7 @@ export const tableKeymap = $useKeymap('tableKeymap', {
70
68
} ,
71
69
} ,
72
70
ExitTable : {
73
- shortcuts : [ 'Mod-Enter' ] ,
71
+ shortcuts : [ 'Mod-Enter' , 'Enter' ] ,
74
72
command : ( ctx ) => {
75
73
const commands = ctx . get ( commandsCtx )
76
74
You can’t perform that action at this time.
0 commit comments