From 80febafd26176dc65a2910d4aa85ae1b0ba2d743 Mon Sep 17 00:00:00 2001 From: Jonatan Heyman Date: Thu, 19 Jan 2023 11:31:49 +0100 Subject: [PATCH] Small optimization of external noteContent parser --- src/editor/lang-heynote/external-tokens.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/editor/lang-heynote/external-tokens.js b/src/editor/lang-heynote/external-tokens.js index 0d30680..6b8ffbf 100644 --- a/src/editor/lang-heynote/external-tokens.js +++ b/src/editor/lang-heynote/external-tokens.js @@ -35,8 +35,11 @@ export const noteContent = new ExternalTokenizer((input) => { input.acceptToken(NoteContent, 1); return; } - - current = input.advance(); + if (next !== FIRST_TOKEN_CHAR) { + current = input.advance(2); + } else { + current = input.advance(1); + } next = input.peek(1); } });