File tree Expand file tree Collapse file tree 2 files changed +18
-2
lines changed
packages/core/src/blocks/ListItem Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change 1+ import { getBlockInfoFromSelection } from "../../../api/getBlockInfoFromPos.js" ;
12import { createBlockNoteExtension } from "../../../editor/BlockNoteExtension.js" ;
23import { createBlockConfig , createBlockSpec } from "../../../schema/index.js" ;
34import {
@@ -103,7 +104,14 @@ export const createBulletListItemBlockSpec = createBlockSpec(
103104 inputRules : [
104105 {
105106 find : new RegExp ( `^[-+*]\\s$` ) ,
106- replace ( ) {
107+ replace ( { editor } ) {
108+ const blockInfo = getBlockInfoFromSelection (
109+ editor . prosemirrorState ,
110+ ) ;
111+
112+ if ( blockInfo . blockNoteType === "heading" ) {
113+ return ;
114+ }
107115 return {
108116 type : "bulletListItem" ,
109117 props : { } ,
Original file line number Diff line number Diff line change 1+ import { getBlockInfoFromSelection } from "../../../api/getBlockInfoFromPos.js" ;
12import { createBlockNoteExtension } from "../../../editor/BlockNoteExtension.js" ;
23import { createBlockConfig , createBlockSpec } from "../../../schema/index.js" ;
34import {
@@ -95,7 +96,14 @@ export const createNumberedListItemBlockSpec = createBlockSpec(
9596 inputRules : [
9697 {
9798 find : new RegExp ( `^(\\d+)\\.\\s$` ) ,
98- replace ( { match } ) {
99+ replace ( { match, editor } ) {
100+ const blockInfo = getBlockInfoFromSelection (
101+ editor . prosemirrorState ,
102+ ) ;
103+
104+ if ( blockInfo . blockNoteType === "heading" ) {
105+ return ;
106+ }
99107 const start = parseInt ( match [ 1 ] ) ;
100108 return {
101109 type : "numberedListItem" ,
You can’t perform that action at this time.
0 commit comments