Removing the last span from a paragraph was causing ensureTerminatorAfterReplace() to create a new terminatorSpan.