Skip to content

Commit a0fc6e2

Browse files
committed
Small fixes
1 parent fc9e452 commit a0fc6e2

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

packages/core/src/blks/Heading/definition.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { updateBlockTr } from "../../api/blockManipulation/commands/updateBlock/updateBlock.js";
22
import { getBlockInfoFromTransaction } from "../../api/getBlockInfoFromPos.js";
3+
import { defaultProps } from "../../blocks/defaultProps.js";
34
import { createToggleWrapper } from "../../blocks/ToggleWrapper/createToggleWrapper.js";
45
import {
56
createBlockConfig,
@@ -24,6 +25,7 @@ const config = createBlockConfig(
2425
}: HeadingOptions = {}) => ({
2526
type: "heading" as const,
2627
propSchema: {
28+
...defaultProps,
2729
level: { default: defaultLevel, values: levels },
2830
...(allowToggleHeadings ? { isToggleable: { default: false } } : {}),
2931
},

packages/core/src/blocks/defaultBlockTypeGuards.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,10 @@ export function editorHasBlockWithType<
3333
any,
3434
any
3535
> {
36-
if (!editorHasBlockWithType(editor, blockType)) {
36+
if (!(blockType in editor.schema.blockSpecs)) {
3737
return false;
3838
}
39+
3940
if (!props) {
4041
return true;
4142
}

0 commit comments

Comments
 (0)