Skip to content

Commit

Permalink
Fix a problem in document rendering
Browse files Browse the repository at this point in the history
FIX: Fix a bug that could corrupt the DOM view for specific changes involving
newlines and mark decorations.

Issue codemirror/dev#1265
  • Loading branch information
marijnh committed Oct 2, 2023
1 parent 675a576 commit a050806
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/buildview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ export class ContentBuilder implements SpanIterator<Decoration> {
finish(openEnd: number) {
if (this.pendingBuffer && openEnd <= this.bufferMarks.length) this.flushBuffer()
else this.pendingBuffer = Buf.No
if (!openEnd && !this.posCovered()) this.getLine()
if (!this.posCovered() &&
!(openEnd && this.content.length && this.content[this.content.length - 1] instanceof BlockWidgetView))
this.getLine()
}

buildText(length: number, active: readonly MarkDecoration[], openStart: number) {
Expand Down

0 comments on commit a050806

Please sign in to comment.