mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-16 19:57:52 +01:00
editor: fix crash when inserting a code block
This commit is contained in:
@@ -243,7 +243,7 @@ export const CodeBlock = Node.create<CodeBlockOptions>({
|
||||
tr.replaceSelectionWith(
|
||||
this.type.create(
|
||||
{ ...attributes, id: createCodeblockId() },
|
||||
state.schema.text(text)
|
||||
text ? state.schema.text(text) : null
|
||||
)
|
||||
);
|
||||
return commands.setTextSelection({ from, to: tr.mapping.map(to) });
|
||||
|
||||
Reference in New Issue
Block a user