Repository navigation
Fix ODT comments leaking into paragraph text - #206
Open
crown-sports wants to merge 1 commit into
Open
crown-sports wants to merge 1 commit into
crown-sports wants to merge 1 commit into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ODT comments currently become part of the paragraph they annotate. On the reproduction in #203,
Lamb+ comment +dawordbecomesLambAuthor2026-01-01T00:00:00COMMENTTEXTdaword. This change keepsLambdawordintact and omits the comment's author, date, and body.walk_inlineschecked forannotationin 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.Text with a comment on Lambdaword here.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
LambanddawordproducedLambAuthor2026-01-01T00:00:00COMMENTTEXTdaword; now the adjacent text stays intact and the comment's author, date, and body are omitted.walk_inlinesonly checked text-namespaceannotationelements, 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.Written for commit 5c65459. Summary will update on new commits.