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.
This commit is contained in:
Jonatan Heyman 2023-12-24 00:13:17 +01:00
parent 206abbc31c
commit bb9a39fe6e

View File

@ -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