Skip to content

fix(docx): preserve symbol checkbox states - #177

Open
HanZephyr wants to merge 2 commits into
firecrawl:mainfrom
HanZephyr:codex/fix-docx-symbol-checkboxes
Open

HanZephyr wants to merge 2 commits into
firecrawl:mainfrom
HanZephyr:codex/fix-docx-symbol-checkboxes

Conversation

@HanZephyr

@HanZephyr HanZephyr commented Sep 20, 2026

Copy link
Copy Markdown

DOCX checkbox symbols stored as w:sym were dropped during parsing. In a table containing a checked option followed by an unchecked alternative, this left the alternative as bare text and changed how the content could be interpreted.

Map the supported Wingdings and Wingdings 2 checked/unchecked glyphs to Unicode, including their private-use encodings, while retaining run styling and text order. Unknown or malformed symbols keep the existing behavior. Tests use only synthetic in-memory documents.

Validation: cargo test --locked (299 passed, 1 ignored), cargo clippy --workspace --all-targets --all-features -- -D warnings, and cargo fmt --all --check. Regression tests fail before the fix and pass afterward.


Summary by cubic

Fixes DOCX parsing so checkbox symbols stored as w:sym are preserved instead of dropped, which previously left unchecked options as bare text in tables.

Maps supported Wingdings and Wingdings 2 checked/unchecked glyphs to their Unicode equivalents, including private-use encodings, and retains run styling and text order. Rejects malformed or overlong character codes and keeps existing unsupported-symbol behavior for unknown font/code pairs.

Written for commit 2f0907d. Summary will update on new commits.

Review in cubic

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 3 files

Confidence score: 4/5

  • In src/formats/docx/mod.rs, malformed Wingdings w:char values such as +00A3 can be incorrectly emitted as checkboxes, producing inaccurate document output; validate the attribute contains only the permitted short hexadecimal digits before parsing.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="src/formats/docx/mod.rs">

<violation number="1" location="src/formats/docx/mod.rs:9">
P2: When a Wingdings symbol has a malformed `w:char` such as `+00A3`, the new symbol parser still emits a checkbox. Validate that the attribute contains only the permitted short hexadecimal digits before parsing so malformed symbols keep the existing behavior.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

Comment thread src/formats/docx/mod.rs
mod content;
mod numbering;
mod styles;
mod symbols;

@cubic-dev-ai cubic-dev-ai Bot Sep 20, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: When a Wingdings symbol has a malformed w:char such as +00A3, the new symbol parser still emits a checkbox. Validate that the attribute contains only the permitted short hexadecimal digits before parsing so malformed symbols keep the existing behavior.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/formats/docx/mod.rs, line 9:

<comment>When a Wingdings symbol has a malformed `w:char` such as `+00A3`, the new symbol parser still emits a checkbox. Validate that the attribute contains only the permitted short hexadecimal digits before parsing so malformed symbols keep the existing behavior.</comment>

<file context>
@@ -6,6 +6,7 @@
 mod content;
 mod numbering;
 mod styles;
+mod symbols;
 
 use crate::error::ConvertError;
</file context>
Fix with cubic

This branch has not been deployed

No deployments
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.

1 participant