Fix bug causing an endless loop with the lang auto detector continuously changing the language of the current block

This commit is contained in:
Jonatan Heyman 2023-01-19 00:18:18 +01:00
parent 335390d8e5
commit c4e78a70ce

View File

@ -78,8 +78,10 @@ export function languageDetection(getView) {
// if content is cleared, set language to plaintext // if content is cleared, set language to plaintext
const view = getView() const view = getView()
const block = getActiveNoteBlock(view.state) const block = getActiveNoteBlock(view.state)
if (block.language.name !== "text") {
changeLanguageTo(view.state, view.dispatch, block, "text", true) changeLanguageTo(view.state, view.dispatch, block, "text", true)
} }
}
if (content.length <= 8) { if (content.length <= 8) {
return return
} }