Skip to content

Commit 10680e6

Browse files
committed
Add and remove new line in order to redraw a heading
1 parent 213b7ed commit 10680e6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,8 @@ class BlockFormatter(editor: AztecText,
165165

166166
if (span != null) {
167167
removeBlockStyle(span.textFormat)
168+
editableText.insert(selectionEnd, "\n")
169+
editableText.delete(selectionEnd, selectionEnd+1)
168170
}
169171

170172
removeBlockStyle(AztecTextFormat.FORMAT_PREFORMAT)
@@ -857,6 +859,8 @@ class BlockFormatter(editor: AztecText,
857859

858860
HeadingHandler.cloneHeading(editableText, headingSpan, alignmentRendering, lineStart, lineEnd)
859861
}
862+
editableText.insert(end, "\n")
863+
editableText.delete(end, end+1)
860864
}
861865

862866
private fun liftBlock(textFormat: ITextFormat, start: Int, end: Int) {

0 commit comments

Comments
 (0)