Skip to content

Commit ac0d392

Browse files
committed
Fixed remaining parse/paste issues
1 parent 258520f commit ac0d392

File tree

11 files changed

+39
-2
lines changed

11 files changed

+39
-2
lines changed

examples/01-basic/01-minimal/src/App.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,17 @@ import { useCreateBlockNote } from "@blocknote/react";
55

66
export default function App() {
77
// Creates a new editor instance.
8-
const editor = useCreateBlockNote();
8+
const editor = useCreateBlockNote({
9+
initialContent: [
10+
{
11+
type: "paragraph",
12+
content: "Paragraph 1",
13+
},
14+
{
15+
type: "paragraph",
16+
},
17+
],
18+
});
919

1020
// Renders the editor instance using a React component.
1121
return <BlockNoteView editor={editor} />;

packages/core/src/blocks/Code/block.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ export const createCodeBlockConfig = createBlockConfig(
6464
meta: {
6565
code: true,
6666
defining: true,
67+
isolating: false,
6768
},
6869
}) as const,
6970
);

packages/core/src/blocks/Heading/block.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ export const createHeadingBlockConfig = createBlockConfig(
3030
: {}),
3131
},
3232
content: "inline",
33+
meta: {
34+
isolating: false,
35+
},
3336
}) as const,
3437
);
3538

packages/core/src/blocks/ListItem/BulletListItem/block.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ export const createBulletListItemBlockConfig = createBlockConfig(
1414
...defaultProps,
1515
},
1616
content: "inline",
17+
meta: {
18+
isolating: false,
19+
},
1720
}) as const,
1821
);
1922

packages/core/src/blocks/ListItem/CheckListItem/block.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ export const createCheckListItemConfig = createBlockConfig(
1515
checked: { default: false, type: "boolean" },
1616
},
1717
content: "inline",
18+
meta: {
19+
isolating: false,
20+
},
1821
}) as const,
1922
);
2023

packages/core/src/blocks/ListItem/NumberedListItem/block.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ export const createNumberedListItemBlockConfig = createBlockConfig(
1616
start: { default: undefined, type: "number" } as const,
1717
},
1818
content: "inline",
19+
meta: {
20+
isolating: false,
21+
},
1922
}) as const,
2023
);
2124

packages/core/src/blocks/ListItem/ToggleListItem/block.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ export const createToggleListItemBlockConfig = createBlockConfig(
1414
...defaultProps,
1515
},
1616
content: "inline" as const,
17+
meta: {
18+
isolating: false,
19+
},
1720
}) as const,
1821
);
1922

packages/core/src/blocks/Paragraph/block.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ export const createParagraphBlockConfig = createBlockConfig(
1010
type: "paragraph" as const,
1111
propSchema: defaultProps,
1212
content: "inline" as const,
13+
meta: {
14+
isolating: false,
15+
},
1316
}) as const,
1417
);
1518

packages/core/src/blocks/Quote/block.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ export const createQuoteBlockConfig = createBlockConfig(
1313
textColor: defaultProps.textColor,
1414
},
1515
content: "inline" as const,
16+
meta: {
17+
isolating: false,
18+
},
1619
}) as const,
1720
);
1821

packages/core/src/schema/blocks/createSpec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ export function addNodeAndExtensionsToSpec<
147147
: blockConfig.content) as TContent extends "inline" ? "inline*" : "",
148148
group: "blockContent",
149149
selectable: blockConfig.meta?.selectable ?? true,
150-
isolating: true,
150+
isolating: blockConfig.meta?.isolating ?? true,
151151
code: blockConfig.meta?.code ?? false,
152152
defining: blockConfig.meta?.defining ?? true,
153153
priority,

0 commit comments

Comments
 (0)