Editing text across block boundaries
One text range, one replacement, with the rest of the note intact.

Replacing a few words can remove a block boundary. The unselected text at either end still belongs in the note, with its formatting intact and a clear place for the next character.
Phrase supports a continuous text range across blocks. Replacing that range changes the selected text and the affected structure together, then leaves the cursor where writing continues.
That is the editing problem behind familiar keys such as Enter and Backspace. The visible result is a small revision. Underneath, the document needs to keep text, formatting, structure, and undo in agreement.
Preserve what the selection leaves behind
A range can begin in the middle of one block and end in the middle of another. We preserve the unselected words at both ends while applying the replacement to the selected passage.
The operation belongs to the document, so a boundary between text blocks does not turn one revision into a set of disconnected edits. The selection afterward is part of the result too: the next character needs a definite place to go.
The document's length adds another constraint: one local revision should not force us to typeset every unchanged paragraph. Our 10,000-block Mac tests measure the editor work behind character insertion and structural edits.
Change the structure with the text
Enter and Backspace are useful tests of that same model. A split creates a new block. A join removes a boundary. In both cases, the words and their formatting have to survive in the right place.
Styled words keep their styling through a split. Backspace at the new paragraph's start rejoins the text. A code block can retain a newline within itself, while a checklist gives Enter another structural meaning.
We define these behaviors in the editing system, where the surrounding content is available. A block's visual boundary alone cannot decide what the writer meant.
Undo the action the writer made
A replacement across several blocks is still one action from the writer's point of view. Undo needs to restore both the text and the structure affected by it.
Restoring the words in different blocks would not restore the original note. Restoring the blocks while leaving the selection in an unrelated place would also interrupt the next edit. We keep those responsibilities connected through the operation.
IME composition adds provisional text that can change before acceptance. We handle that state separately so candidate revisions do not become a misleading history of finished edits.
Two scales of selection
Selecting a text range and selecting whole blocks are both useful, but they express different intentions.
A text range lets us rewrite part of a passage across block boundaries. Whole-block selection lets us gather a heading, checklist items, or other complete blocks and reorganize them as units. Our two-finger selection and drag gestures make the second scale direct on iPhone.
We built the editor to support both in the same note. Structure helps organize the work; continuous text selection keeps that structure from getting in the way of revision.
Try a passage that spans two text blocks in Phrase for iPhone. Select the words you want to change and replace them together.