From 544a43b1918e981641abcf4fb451da37fd676144 Mon Sep 17 00:00:00 2001 From: Aljaz Grilc Date: Fri, 16 Feb 2024 10:08:34 +0100 Subject: [PATCH] Add feature to reposition mistakes functionality after text replacement --- online-editor.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/online-editor.js b/online-editor.js index 7a01f52..2822ab2 100644 --- a/online-editor.js +++ b/online-editor.js @@ -368,6 +368,10 @@ class BesEditor { text.substring(match.offset + match.length) el.textContent = newText BesEditor.clearSingleMistake(editor, el, rect) + // In my opinion, this approach provides the most straightforward solution for repositioning mistakes after a change. + // It maintains reasonable performance as it only checks the block element that has been modified, + // rather than re-evaluating the entire document or a larger set of elements. + editor.proof(el) } // This function clears a single mistake