Skip to content

Commit 3a6ab4f

Browse files
committed
Don't bail when ZWJ cleanup found end-of-text marker
Cleanup needs to continue and remove the rest of the ZWJs if any.
1 parent 7e968c3 commit 3a6ab4f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

aztec/src/main/kotlin/org/wordpress/aztec/AztecParser.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -335,8 +335,9 @@ class AztecParser @JvmOverloads constructor(val plugins: List<IAztecPlugin> = li
335335
do {
336336
lastIndex = text.lastIndexOf(Constants.ZWJ_CHAR, lastIndex)
337337
if (lastIndex == text.length - 1) {
338-
// ZWJ at the end of text will serve as end-of-text marker so, let it be and finish.
339-
return
338+
// ZWJ at the end of text will serve as end-of-text marker so, let it be and continue cleaning up ZWJs
339+
lastIndex--
340+
continue
340341
}
341342

342343
if (lastIndex > -1) {

0 commit comments

Comments
 (0)