Skip to content

Fix ODT comments leaking into paragraph text - #206

Open
crown-sports wants to merge 1 commit into
firecrawl:mainfrom
crown-sports:fix/odf-annotation-body
Open

crown-sports wants to merge 1 commit into
firecrawl:mainfrom
crown-sports:fix/odf-annotation-body

Conversation

@crown-sports

@crown-sports crown-sports commented Oct 23, 2026 •

Copy link
Copy Markdown

ODT comments currently become part of the paragraph they annotate. On the reproduction in #203, Lamb + comment + daword becomes LambAuthor2026-01-01T00:00:00COMMENTTEXTdaword. This change keeps Lambdaword intact and omits the comment's author, date, and body.

walk_inlines checked for annotation in the text namespace, while ODF comments use the office namespace. Skip that subtree before recursing into inline children. The check uses the resolved namespace URI, so alternate XML prefixes work too.

Two integration tests construct ODT ZIPs and call to_markdown_bytes: a point comment inside a word, and a ranged comment inside a link/span using an alternate prefix. They check that adjacent text and the link survive. Both tests fail before the production fix and pass afterward.

Related to #203. This fixes the annotation portion only; nested list numbering is unchanged and the issue should remain open for that work.

Validation on macOS arm64:

  • cargo test --locked: 300 passed, 1 existing ignored local-samples test.
  • cargo fmt --all --check: passed.
  • PYO3_PYTHON=/opt/homebrew/opt/python@3.12/bin/python3.12 cargo clippy --locked --workspace --all-targets --all-features -- -D warnings: passed.
  • The original issue's ODT fixture now converts to Text with a comment on Lambdaword here.
  • Separate review and rerun of the two new regression tests: passed.

AI assistance was used for implementation, testing, and review. Node, Python, and Wasm runtime suites were not run locally; upstream CI remains the cross-platform check.


Summary by cubic

Fixes ODT comments leaking into the paragraph they annotate. Previously, a comment between Lamb and daword produced LambAuthor2026-01-01T00:00:00COMMENTTEXTdaword; now the adjacent text stays intact and the comment's author, date, and body are omitted.

  • walk_inlines only checked text-namespace annotation elements, while ODF comments use the office namespace. Skip that subtree before recursing into inline children; the check uses the resolved namespace URI, so alternate prefixes work too.
  • Adds two integration tests covering a point comment inside a word and a ranged comment inside a link; both fail before this fix and pass after. This addresses only the annotation part of ODT: nested list numbering continues across parents (2.1 renders as 2.3); annotations are inlined into the anchored word #203; nested list numbering is unchanged, and the issue stays open for that work.

Written for commit 5c65459. Summary will update on new commits.

View guided diff

@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.

No issues found across 2 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

View guided diff | Re-trigger 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