mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-16 11:47:54 +01:00
editor: fix crash in heading plugin when pasting markdown content
Signed-off-by: 01zulfi <85733202+01zulfi@users.noreply.github.com>
This commit is contained in:
@@ -365,6 +365,8 @@ const headingUpdatePlugin = new Plugin({
|
|||||||
|
|
||||||
newDoc.descendants((newNode, pos) => {
|
newDoc.descendants((newNode, pos) => {
|
||||||
if (newNode.type.name === "heading") {
|
if (newNode.type.name === "heading") {
|
||||||
|
if (pos >= oldDoc.content.size) return;
|
||||||
|
|
||||||
const oldNode = oldDoc.nodeAt(pos);
|
const oldNode = oldDoc.nodeAt(pos);
|
||||||
if (
|
if (
|
||||||
oldNode &&
|
oldNode &&
|
||||||
|
|||||||
Reference in New Issue
Block a user