Skip to content

Commit b3df379

Browse files
committed
Added comments, do not copy "service" spans into new content.
1 parent fb2d9fd commit b3df379

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -675,10 +675,11 @@ open class AztecText : AppCompatEditText, TextWatcher, UnknownHtmlSpan.OnUnknown
675675
val equalStringValues = source.toString() == dest.toString()
676676
val equalRange = start == 0 && dstart == 0 && end == source.length && dend == source.length
677677

678-
679678
if (equalStringValues && equalRange) {
679+
// we can't just return a dest, so we need to copy it into a new spannable string
680+
// this will also strip all the internal "service" spans
680681
temp = SpannableStringBuilder(dest)
681-
TextUtils.copySpansFrom(dest, 0, dest.length, Any::class.java, temp, 0)
682+
// copy all the suggestion spans from the source, so we can see underlines
682683
if (source is Spanned) {
683684
TextUtils.copySpansFrom(source, 0, dest.length, SuggestionSpan::class.java, temp, 0)
684685
}

0 commit comments

Comments
 (0)