Skip to content

Commit 558a71e

Browse files
feat: disable conversion of headings to list items (#1799)
1 parent 0148428 commit 558a71e

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

docs/pages/docs/editor-basics/setup.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ type BlockNoteEditorOptions = {
4343
pasteBehavior?: "prefer-markdown" | "prefer-html";
4444
}) => boolean | undefined;
4545
}) => boolean | undefined;
46-
resolveFileUrl: (url: string) => Promise<string>
46+
resolveFileUrl: (url: string) => Promise<string>;
4747
schema?: BlockNoteSchema;
4848
setIdAttribute?: boolean;
4949
sideMenuDetection?: "viewport" | "editor";

packages/core/src/blocks/ListItemBlockContent/BulletListItemBlockContent/BulletListItemBlockContent.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ const BulletListItemBlockContent = createStronglyTypedTiptapNode({
3131
const blockInfo = getBlockInfoFromSelection(state);
3232
if (
3333
!blockInfo.isBlockContainer ||
34-
blockInfo.blockContent.node.type.spec.content !== "inline*"
34+
blockInfo.blockContent.node.type.spec.content !== "inline*" ||
35+
blockInfo.blockNoteType === "heading"
3536
) {
3637
return;
3738
}

packages/core/src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListItemBlockContent.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ const NumberedListItemBlockContent = createStronglyTypedTiptapNode({
5050
if (
5151
!blockInfo.isBlockContainer ||
5252
blockInfo.blockContent.node.type.spec.content !== "inline*" ||
53-
blockInfo.blockNoteType === "numberedListItem"
53+
blockInfo.blockNoteType === "numberedListItem" ||
54+
blockInfo.blockNoteType === "heading"
5455
) {
5556
return;
5657
}

0 commit comments

Comments
 (0)