From 92830cafab8500e2ab3dfc6d7b8f3b51c2f5624a Mon Sep 17 00:00:00 2001 From: kotaindah55 Date: Thu, 20 Mar 2025 16:37:53 +0200 Subject: [PATCH] fix(parser): error when encounter math syntax in a blockquote This happen when getShifterStart() was trying to get math open inside a blockquote. Normally, getOpen() method in the ShifterNodeConfigs will recursively look for any of shifter node behind, using node.prevSibling prop to catch it. It doesn't result null value, except for the mentioned case above. So, we need to track the parent firstly, in this case it's a blockquote node, then get the previous sibling (it's blockquote too) and pick its last child (which is another math node). --- src/editor-mode/parser/configs/ShifterNodeConfigs.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/editor-mode/parser/configs/ShifterNodeConfigs.ts b/src/editor-mode/parser/configs/ShifterNodeConfigs.ts index d4e8b40..2b0cd50 100644 --- a/src/editor-mode/parser/configs/ShifterNodeConfigs.ts +++ b/src/editor-mode/parser/configs/ShifterNodeConfigs.ts @@ -20,7 +20,9 @@ export const ShifterNodeConfigs: Record