Replaces this block with replacement in its parent container.
public void ReplaceBy(Block replacement, bool moveChildren = true)
The replacement block.
true to transfer children when both this block and replacement are containers.
This method does not recompute spans or trivia. Callers are responsible for updating those values if a transform requires exact source information after replacement.