Skip to content

Commit

Permalink
don't unconditionally use toString for span reconstruction after coll…
Browse files Browse the repository at this point in the history
…apse, fixes #195
  • Loading branch information
Valodim authored and mgod committed Mar 23, 2016
1 parent 9ff8094 commit 5475806
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1069,7 +1069,15 @@ private void insertSpan(T object, CharSequence sourceText) {
}

private void insertSpan(T object) {
insertSpan(object, object.toString());
String spanString;
// The information about the original text is lost here, so other than "toString" we have no data
if (deletionStyle == TokenDeleteStyle.ToString) {
spanString = object != null ? object.toString() : "";
} else {
spanString = "";
}

insertSpan(object, spanString);
}

private void insertSpan(TokenImageSpan span) {
Expand Down

0 comments on commit 5475806

Please sign in to comment.