File tree Expand file tree Collapse file tree 3 files changed +11
-14
lines changed
examples/01-basic/01-minimal/src Expand file tree Collapse file tree 3 files changed +11
-14
lines changed Original file line number Diff line number Diff line change @@ -2,18 +2,10 @@ import "@blocknote/core/fonts/inter.css";
22import { BlockNoteView } from "@blocknote/mantine" ;
33import "@blocknote/mantine/style.css" ;
44import { useCreateBlockNote } from "@blocknote/react" ;
5- import { BlockNoteSchema2 } from "@blocknote/core" ;
6- import { codeBlock } from "@blocknote/code-block" ;
7-
8- const schema = BlockNoteSchema2 . create ( undefined , {
9- codeBlock,
10- } ) ;
115
126export default function App ( ) {
137 // Creates a new editor instance.
14- const editor = useCreateBlockNote ( {
15- schema : schema as any ,
16- } ) ;
8+ const editor = useCreateBlockNote ( ) ;
179
1810 // Renders the editor instance using a React component.
1911 return < BlockNoteView editor = { editor } /> ;
Original file line number Diff line number Diff line change @@ -98,11 +98,14 @@ export class CustomBlockNoteSchema<
9898 {
9999 extensions : blockDef . extensions ,
100100 } ,
101- createBlockSpec (
102- blockDef . config ,
103- blockDef . implementation as any ,
104- getPriority ( key ) ,
105- ) ,
101+ // TODO annoying hack to get tables to work
102+ blockDef . config . type === "table"
103+ ? blockDef
104+ : createBlockSpec (
105+ blockDef . config ,
106+ blockDef . implementation as any ,
107+ getPriority ( key ) ,
108+ ) ,
106109 ) ,
107110 ] ;
108111 } ,
Original file line number Diff line number Diff line change @@ -335,6 +335,8 @@ export function createBlockSpec<
335335 blockContentDOMAttributes ,
336336 ) ;
337337 } ,
338+ // Only needed for tables right now, remove later
339+ requiredExtensions : ( blockImplementation as any ) . requiredExtensions ,
338340 } ) ;
339341}
340342
You can’t perform that action at this time.
0 commit comments