mirror of
https://github.com/heyman/heynote.git
synced 2024-12-23 07:08:49 +01: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,7 +78,9 @@ export function languageDetection(getView) {
|
||||
// if content is cleared, set language to plaintext
|
||||
const view = getView()
|
||||
const block = getActiveNoteBlock(view.state)
|
||||
changeLanguageTo(view.state, view.dispatch, block, "text", true)
|
||||
if (block.language.name !== "text") {
|
||||
changeLanguageTo(view.state, view.dispatch, block, "text", true)
|
||||
}
|
||||
}
|
||||
if (content.length <= 8) {
|
||||
return
|
||||
|
Loading…
Reference in New Issue
Block a user