Repository navigation
Conversation
Found while testing crates/format/src/rtf.rs:301-326 (symbol / text, reached via escape) Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com> Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
UTF-8 symbol parsing crates/format/src/rtf.rs |
Outline::symbol advances by the next character’s UTF-8 byte length and appends non-ASCII control symbols. A regression test checks that the symbol and following text are retained. |
Priority:
Estimated code review effort: 2 (Simple) | ~5 minutes
Change: Bug fix
Suggested reviewers: dylanmtaylor
Merge Risk: 
Minimal · up to d8936
-
No actionable merge risk remains; the focused test could not run only because no Rust toolchain was configured.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passedFull details: Docstring Coverage
-
Explanation
Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 2 functions across 1 files.
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
-
Finishing Touches
-
🧪 Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Comment @coderabbitai help to get the list of available commands.
|
Review notes (comment only). Read the diff and ran |
FredApps
left a comment
There was a problem hiding this comment.
ReviewerA — source-read COMMENT (not an approval)
I read the whole diff: after a backslash the RTF outline reader now advances by a whole UTF-8 character (advance) and keeps that character, instead of stepping one byte into the middle of it, with a test (A\éB). Correct and safe on char boundaries (get(i..) returns None otherwise).
I ran nothing and have no exact-head CI result for this PR, so this is not an approval.
Status: waiting_author.
Found while testing
crates/format/src/rtf.rs:301-326 (symbol / text, reached via escape)(no existing issue): RTF outline import drops the rest of a paragraph after a backslash followed by a multi-byte character.Cause
In
rtf_to_outline,symbol()advanced the cursor by one byte. For a backslash followed by a multi-byte character, that left the cursor inside the UTF-8 character. The nexttext()run then started at a non-character boundary,rtf.get(..)returned None, and the text up to the next special character was silently dropped.Fix
symbol()now advances past the whole character using the existing boundary-awareadvance()helper. For a non-ASCII control symbol it also emits that character, soA\éBimports asAéB.Verified
rtf::tests::multibyte_control_symbol_keeps_character_and_following_text: fails onmainwithout the fix and passes with it (cargo test -p deckcraft-format multibyte_control_symbol_keeps_character_and_following_text).cargo xtask cipasses exceptbackstage::tests::start_screen_opens_the_palette_and_preferences, which also fails onmainwithout this change.Not changed
Unknown ASCII control symbols are still ignored. I made no other changes to RTF parsing.
🤖 Generated with AI by ApolloOffice, see the Co-Authored-By trailers for the models
Summary by CodeRabbit