Skip to content

Commit 22fa6e0

Browse files
committed
Fixed broken test.
1 parent 28a0837 commit 22fa6e0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,8 @@ class BlockFormatter(editor: AztecText, listStyle: ListStyle, quoteStyle: QuoteS
137137
spanEnd += textChangedEvent.count
138138
} else if (indexOfLineEnd == -1) {
139139
spanEnd = text.length
140+
} else {
141+
spanEnd = indexOfLineEnd
140142
}
141143

142144
if (spanEnd <= textLength) {
@@ -231,7 +233,7 @@ class BlockFormatter(editor: AztecText, listStyle: ListStyle, quoteStyle: QuoteS
231233
}
232234
} else if (!textChangedEvent.isAddingCharacters && !textChangedEvent.isNewLineButNotAtTheBeginning()) {
233235
val deletedCharacterIsNewline = textChangedEvent.textBefore[textChangedEvent.inputEnd] == '\n'
234-
if(!deletedCharacterIsNewline) return
236+
if (!deletedCharacterIsNewline) return
235237

236238
// backspace on a line right after a list attaches the line to the last item
237239
val blockSpan = editableText.getSpans(inputEnd, inputEnd, AztecBlockSpan::class.java).firstOrNull()

0 commit comments

Comments
 (0)