From 5bdfdd30ea6113ef54ca7b4089f51d0475e98b8d Mon Sep 17 00:00:00 2001 From: rhenck <richard.henck@iqb.hu-berlin.de> Date: Sat, 20 Nov 2021 20:49:26 +0100 Subject: [PATCH] [editor] Fix console error in TipTap extension --- projects/editor/src/app/text-editor/orderedList-extension.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/projects/editor/src/app/text-editor/orderedList-extension.ts b/projects/editor/src/app/text-editor/orderedList-extension.ts index fccac3710..59cd17ac2 100644 --- a/projects/editor/src/app/text-editor/orderedList-extension.ts +++ b/projects/editor/src/app/text-editor/orderedList-extension.ts @@ -30,7 +30,9 @@ export const orderedListExtension = OrderedList.extend({ const node = tr?.doc?.nodeAt(pos); if (node) { const nodeAttrs = { ...node.attrs, listStyle: newStyle }; - return tr.setNodeMarkup(pos, node.type, nodeAttrs, node.marks); + if (node.type.name !== 'text') { + return tr.setNodeMarkup(pos, node.type, nodeAttrs, node.marks); + } } return tr; }; -- GitLab