fix(rtf): omit text of deleted revisions

AS
3d ago
+54-2

Fixes the RTF part of #202. The DOC part is #174; DOCX is untouched.

Problem

RTF tracked deletions (\deleted) were printed as live text. The parties agreed {\deleted OLDTERM }{\revised NEWTERM }terms. rendered as The parties agreed OLDTERM NEWTERM terms., so both the old and the new wording appeared.

Change

\deleted (and \deleted0) now sets a group-scoped deleted flag on the character state. Body text under that flag is left out. Pending bytes are flushed before the flag changes, so text on either side of the toggle keeps its own state. Insertions (\revised) stay as before.

Verification

  • New test deleted_revision_text_is_omitted covers both forms: a group-scoped deletion and an inline \deleted ... \deleted0. It fails on main and passes with the change.
  • cargo test: all suites pass.
  • rustfmt --check on the changed file: clean.

šŸ¤– Generated with Claude Code


Summary by cubic

Fixes the RTF part of #202: tracked deletions (\deleted) were rendered as live text, so both old and new wording of a revised clause appeared. Deleted text — including line breaks, pictures, and equations — is now omitted from the output, and a deleted paragraph mark joins its paragraphs and drops its list marker instead of leaving a blank line; insertions (\revised) stay as before.

  • Adds regression tests covering group-scoped, inline, and element-containing \deleted forms, deleted paragraphs, and code-block output.