Repository navigation
fix(rtf): omit text of deleted revisions - #216
Aschenbath wants to merge 4 commits into
Conversation
A tracked deletion (\deleted) printed as live text, so the old and new wording of a revised clause both appeared. Text inside a deletion is now left out, the same way the DOC path does in firecrawl#174; insertions stay. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
1 issue found across 1 file
Confidence score: 3/5
- Deleted RTF groups can still emit pictures and equations in
src/formats/rtf/mod.rs, exposing content that should be omitted. Make the\pictand\mmathfinishers respect the deleted flag.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="src/formats/rtf/mod.rs">
<violation number="1" location="src/formats/rtf/mod.rs:1162">
P2: The `deleted` gate covers only text. Pictures (`\\pict`) and equations (`\\mmath`) inside a `\\deleted` group are still emitted, because their finishers never check the flag. Record `deleted` when the `\\pict` or `\\mmath` destination opens, and skip emission in `finish_pict`/`finish_math` when it was set.</violation>
</file>
Reply with feedback, questions, or to request a fix.
View guided diff | Re-trigger cubic
| } | ||
| Capture::None => { | ||
| if !self.state.suppress { | ||
| if !self.state.suppress && !self.state.deleted { |
There was a problem hiding this comment.
P2: The deleted gate covers only text. Pictures (\\pict) and equations (\\mmath) inside a \\deleted group are still emitted, because their finishers never check the flag. Record deleted when the \\pict or \\mmath destination opens, and skip emission in finish_pict/finish_math when it was set.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At src/formats/rtf/mod.rs, line 1162:
<comment>The `deleted` gate covers only text. Pictures (`\\pict`) and equations (`\\mmath`) inside a `\\deleted` group are still emitted, because their finishers never check the flag. Record `deleted` when the `\\pict` or `\\mmath` destination opens, and skip emission in `finish_pict`/`finish_math` when it was set.</comment>
<file context>
@@ -1151,7 +1159,7 @@ impl<'a> Parser<'a> {
}
Capture::None => {
- if !self.state.suppress {
+ if !self.state.suppress && !self.state.deleted {
self.inlines.push(Inline::Text { text, style: self.state.style });
}
</file context>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
1 existing issue remains and no new issues found across 1 file (changes from recent commits).
Confidence score: 3/5
- In
src/formats/rtf/mod.rs,finish_pictcan emit images marked deleted in their own picture group because it checks the restored enclosing state. Capture the deletion state when the picture opens and use it when finalizing.
Requires human review: Auto-approval blocked because this review re-detected 1 unresolved P0–P2 issue already reported by Cubic.
View guided diff | Re-trigger cubic
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
All reported issues were addressed across 1 file (changes from recent commits).
Reply with feedback, questions, or to request a fix.
View guided diff | Re-trigger cubic
… list marker Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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 asThe parties agreed OLDTERM NEWTERM terms., so both the old and the new wording appeared.Change
\deleted(and\deleted0) now sets a group-scopeddeletedflag 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
deleted_revision_text_is_omittedcovers 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 --checkon 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.\deletedforms, deleted paragraphs, and code-block output.Written for commit dccaf92. Summary will update on new commits.