mirror of
https://github.com/heyman/heynote.git
synced 2024-11-24 17:03:19 +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) {
|
if (id == NoteContent) {
|
||||||
let noteLang = node.node.parent.firstChild.getChildren(NoteLanguage)[0]
|
let noteLang = node.node.parent.firstChild.getChildren(NoteLanguage)[0]
|
||||||
let langName = input.read(noteLang?.from, noteLang?.to)
|
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) {
|
if (langName in languageMapping && languageMapping[langName] !== null) {
|
||||||
//console.log("found parser for language:", langName)
|
//console.log("found parser for language:", langName)
|
||||||
return {
|
return {
|
||||||
|
Loading…
Reference in New Issue
Block a user