From bb9a39fe6e81853acce1af568dbb437fa9616d92 Mon Sep 17 00:00:00 2001 From: Jonatan Heyman Date: Sun, 24 Dec 2023 00:13:17 +0100 Subject: [PATCH] Fix bug where language auto detection will not trigger in some cases E.g. if you pasted a piece of javascript, selected the whole block and deleted the text (which will change back the default language to Plaintext (auto)) and then paste the same javascript code again. --- src/editor/language-detection/autodetect.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/editor/language-detection/autodetect.js b/src/editor/language-detection/autodetect.js index 4edc941..d39dcd4 100644 --- a/src/editor/language-detection/autodetect.js +++ b/src/editor/language-detection/autodetect.js @@ -79,6 +79,7 @@ export function languageDetection(getView) { if (block.language.name !== "text") { changeLanguageTo(view.state, view.dispatch, block, "text", true) } + delete previousBlockContent[idx] } if (content.length <= 8) { return