mirror of
https://github.com/heyman/heynote.git
synced 2025-06-20 17:47:42 +02:00
Fix bug causing an endless loop with the lang auto detector continuously changing the language of the current block
This commit is contained in:
parent
335390d8e5
commit
c4e78a70ce
@ -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
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user