Skip to content

Files: opening an RTF outline keeps non-breaking hyphens - #1317

Merged
h-a-n-a-s-h-i merged 1 commit into
storytold:mainfrom
marcoarnulfo:fix/rtf-nb-hyphen
Oct 25, 2026
Merged

h-a-n-a-s-h-i merged 1 commit into
storytold:mainfrom
marcoarnulfo:fix/rtf-nb-hyphen

Conversation

@marcoarnulfo

@marcoarnulfo marcoarnulfo commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #1316.

\_ is RTF's non-breaking hyphen, a visible character like the non-breaking space \~, but the outline reader only knew \~ and dropped \_. It now reads it as U+2011 (non-breaking hyphen), next to \~. The export already writes U+2011 back as \u8209?, so the text round-trips.

Validation:

  • rtf::tests::non_breaking_hyphen_is_kept: fails on main ("Yearend review\n"), passes here
  • cargo test --workspace --lib -- rtf:: (deckcraft-format: 6 passed)
  • cargo clippy --workspace --all-targets -- -D warnings, cargo fmt --all -- --check
  • (macOS, Apple silicon)

Summary by CodeRabbit

  • Bug Fixes
    • RTF text containing \_ now displays as a non-breaking hyphen in outline text.

@coderabbitai

coderabbitai Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 38d2ade and 1525dae.

Files selected for processing: 1
  • crates/format/src/rtf.rs

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review.

Walkthrough

The RTF importer now converts the \_ control symbol to U+2011. A test verifies that the non-breaking hyphen remains in the imported outline text.

Changes: RTF non-breaking hyphen import

Layer / File(s) Summary
Map and test the RTF hyphen
crates/format/src/rtf.rs
The control-symbol handler maps \_ to U+2011. A test checks that importing Year\_end review preserves the character in the outline text.

Priority: Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Low

Possibly related PRs

Suggested reviewers: aiongg

Merge Risk: Minimal · up to 1525d

The RTF import change is sound and has no identified merge-blocking risk.

Architecture risk: Medium · up to 1525d

The change affects 1 system.

Changed systems: crates

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — crates (service) was modified; 1 changed file maps to changed impact.

Before / after behavior

  • observed — Modified behavior in crates/format/src/rtf.rs: The RTF control-symbol handler now converts \_ to U+2011; previously it had no case for this symbol.
  • observed — Modified behavior in crates/format/src/rtf.rs: Added a test asserting that importing Year\_end review preserves the non-breaking hyphen in the outline text.

Reliability and maintainability

  • inferred — Risk-relevant change factors for crates: blast_radius_1; direct_dependents_1
Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: preserving non-breaking hyphens when opening RTF outlines.
Linked Issues check Passed Issue #1316 requires rtf_to_outline to preserve the RTF control symbol \\_ as U+2011. The PR summary states that crates/format/src/rtf.rs now maps \\_ to U+2011. The added `rtf::tests::non_break…
Out of Scope Changes check Passed The reported changes add only the \\_ import behavior and its regression test in crates/format/src/rtf.rs. These changes directly support issue #1316. No unrelated changes are reported. The reposit…
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 1 files.
Full details: Linked Issues check

Explanation

Issue #1316 requires rtf_to_outline to preserve the RTF control symbol \_ as U+2011. The PR summary states that crates/format/src/rtf.rs now maps \_ to U+2011. The added rtf::tests::non_breaking_hyphen_is_kept test covers the reported input and expected output. The reported focused test passes.

Full details: Out of Scope Changes check

Explanation

The reported changes add only the \_ import behavior and its regression test in crates/format/src/rtf.rs. These changes directly support issue #1316. No unrelated changes are reported. The repository diff was unavailable, so this assessment relies on the supplied change summary.

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.

@h-a-n-a-s-h-i
h-a-n-a-s-h-i merged commit 5f5f341 into storytold:main Oct 25, 2026
3 checks passed
@echelon

echelon commented Oct 25, 2026

Copy link
Copy Markdown
Member

Landed on main — thank you for the contribution! If you haven't already, come join us on Discord: https://discord.gg/artcraft

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Files: opening an RTF outline drops non-breaking hyphens

3 participants