Skip to content

Commit c45936a

Browse files
fix: add editor parameter to inline content render (core) (#1091)
* add editor parameter to inline content render (core) * Fixed lint issue --------- Co-authored-by: matthewlipski <[email protected]>
1 parent e62e69d commit c45936a

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

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

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import {
44
inlineContentToNodes,
55
nodeToCustomInlineContent,
66
} from "../../api/nodeConversions/nodeConversions";
7+
import type { BlockNoteEditor } from "../../editor/BlockNoteEditor";
78
import { propsToAttributes } from "../blocks/internal";
89
import { Props } from "../propTypes";
910
import { StyleSchema } from "../styles/types";
@@ -34,13 +35,13 @@ export type CustomInlineContentImplementation<
3435
inlineContent: InlineContentFromConfig<T, S>,
3536
updateInlineContent: (
3637
update: PartialCustomInlineContentFromConfig<T, S>
37-
) => void
38+
) => void,
3839
/**
3940
* The BlockNote editor instance
4041
* This is typed generically. If you want an editor with your custom schema, you need to
4142
* cast it manually, e.g.: `const e = editor as BlockNoteEditor<typeof mySchema>;`
4243
*/
43-
// editor: BlockNoteEditor<B, I, S>
44+
editor: BlockNoteEditor<any, any, S>
4445
// (note) if we want to fix the manual cast, we need to prevent circular references and separate block definition and render implementations
4546
// or allow manually passing <BSchema>, but that's not possible without passing the other generics because Typescript doesn't support partial inferred generics
4647
) => {
@@ -109,7 +110,8 @@ export function createInlineContentSpec<
109110
) as any as InlineContentFromConfig<T, S>, // TODO: fix cast
110111
() => {
111112
// No-op
112-
}
113+
},
114+
editor
113115
);
114116

115117
return addInlineContentAttributes(
@@ -148,7 +150,8 @@ export function createInlineContentSpec<
148150
content
149151
)
150152
);
151-
}
153+
},
154+
editor
152155
);
153156

154157
return addInlineContentAttributes(

0 commit comments

Comments
 (0)