Skip to content

Commit 2f9f6d3

Browse files
committed
Add comments
1 parent e54627f commit 2f9f6d3

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

aztec/src/main/kotlin/org/wordpress/aztec/formatting/BlockFormatter.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,9 @@ class BlockFormatter(editor: AztecText,
432432

433433
editableText.removeSpan(span)
434434

435+
// When a span with a different line height is replaced by a paragraph, the editor doesn't redraw
436+
// correctly. This is a hack to force it to redraw by adding and removing a new line after the
437+
// element.
435438
if (span is AztecHeadingSpan) {
436439
editableText.insert(spanEnd, "\n")
437440
editableText.delete(spanEnd, spanEnd+1)
@@ -860,6 +863,8 @@ class BlockFormatter(editor: AztecText,
860863

861864
HeadingHandler.cloneHeading(editableText, headingSpan, alignmentRendering, lineStart, lineEnd)
862865
}
866+
// When a span with a different line height is attached, the editor doesn't redraw correctly. This is a hack to
867+
// force it to redraw by adding and removing a new line after the element.
863868
editableText.insert(end, "\n")
864869
editableText.delete(end, end+1)
865870
}

0 commit comments

Comments
 (0)