From 3a6ab4ffde163ec2f2ebd3732a20013ebd8723a4 Mon Sep 17 00:00:00 2001 From: Stefanos Togkoulidis Date: Sat, 13 Apr 2019 03:48:20 +0300 Subject: [PATCH] Don't bail when ZWJ cleanup found end-of-text marker Cleanup needs to continue and remove the rest of the ZWJs if any. --- aztec/src/main/kotlin/org/wordpress/aztec/AztecParser.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/aztec/src/main/kotlin/org/wordpress/aztec/AztecParser.kt b/aztec/src/main/kotlin/org/wordpress/aztec/AztecParser.kt index 8c920edfb..24de93da1 100644 --- a/aztec/src/main/kotlin/org/wordpress/aztec/AztecParser.kt +++ b/aztec/src/main/kotlin/org/wordpress/aztec/AztecParser.kt @@ -335,8 +335,9 @@ class AztecParser @JvmOverloads constructor(val plugins: List = li do { lastIndex = text.lastIndexOf(Constants.ZWJ_CHAR, lastIndex) if (lastIndex == text.length - 1) { - // ZWJ at the end of text will serve as end-of-text marker so, let it be and finish. - return + // ZWJ at the end of text will serve as end-of-text marker so, let it be and continue cleaning up ZWJs + lastIndex-- + continue } if (lastIndex > -1) {