mirror of
https://github.com/heyman/heynote.git
synced 2024-11-21 23:43:22 +01:00
Fix bug causing editing to break when there are empty blocks of a language that uses a StreamParser
This commit is contained in:
parent
e8971a6733
commit
f33be7f3a4
@ -22,7 +22,13 @@ export function configureNesting() {
|
||||
if (id == NoteContent) {
|
||||
let noteLang = node.node.parent.firstChild.getChildren(NoteLanguage)[0]
|
||||
let langName = input.read(noteLang?.from, noteLang?.to)
|
||||
//console.log("langName:", langName)
|
||||
|
||||
// if the NoteContent is empty, we don't want to return a parser, since that seems to cause an
|
||||
// error for StreamLanguage parsers when the buffer size is large (e.g >300 kb)
|
||||
if (node.node.from == node.node.to) {
|
||||
return null
|
||||
}
|
||||
|
||||
if (langName in languageMapping && languageMapping[langName] !== null) {
|
||||
//console.log("found parser for language:", langName)
|
||||
return {
|
||||
|
Loading…
Reference in New Issue
Block a user