// handle annotation starts
StringMap<String> modified = annotationLogic.stripKeys(
destDoc, pos, cursorBias, ContentType.RICH_TEXT, builder);
// parse the tokens and apply ops
RichTextMutationBuilder mutationBuilder = new RichTextMutationBuilder(modified);
ReadableStringSet affectedKeys =
mutationBuilder.applyMutations(tokenizer, builder, destDoc, insertAt.getContainer());
// close annotations and finish
annotationLogic.unstripKeys(builder, modified.keySet(), affectedKeys);
builder.finish();
Nindo nindo = builder.build();
try {
validator.maybeThrowOperationExceptionFor(nindo);
destOperationSequencer.begin();
destOperationSequencer.consume(nindo);
destOperationSequencer.end();
int cursorLocation = pos + mutationBuilder.getLastGoodCursorOffset();
Point<ContentNode> caret = mapper.locate(cursorLocation);
aggressiveSelectionHelper.setCaret(caret);
} catch (OperationException e) {
LOG.error().log("Paste failed");
aggressiveSelectionHelper.setCaret(insertAt);