Skip to content
This repository was archived by the owner on Apr 15, 2026. It is now read-only.

Commit 67e2013

Browse files
committed
Ensure there's an active line before emitting inline content
FIX: Fix a crash in content DOM building after a block widget.
1 parent 4be27f1 commit 67e2013

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/buildtile.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -426,11 +426,13 @@ export class TileUpdate {
426426
widget.flags &= ~TileFlag.BreakAfter
427427
this.builder.addBlockWidget(widget)
428428
} else {
429+
this.builder.ensureLine(null)
429430
this.builder.addInlineWidget(widget, activeMarks, openMarks)
430431
openMarks = activeMarks.length
431432
}
432433
}
433434
} else if (tile.isText()) {
435+
this.builder.ensureLine(null)
434436
if (!from && to == tile.length) {
435437
this.builder.addText(tile.text, activeMarks, openMarks, this.cache.reuse(tile))
436438
} else {
@@ -445,6 +447,7 @@ export class TileUpdate {
445447
} else if (tile instanceof WidgetBufferTile) {
446448
this.cache.add(tile)
447449
} else if (tile instanceof MarkTile) {
450+
this.builder.ensureLine(null)
448451
this.builder.addMark(tile, activeMarks, openMarks)
449452
this.cache.reused.set(tile, Reused.Full)
450453
openMarks = activeMarks.length

0 commit comments

Comments
 (0)