This is nice and neat. Notice the reuse of the `_replaceNodeWithBrAndSetCaret`.