Skip to content

Fix relationships for markdown headers and footers#7

Open
Bruce-anle wants to merge 2 commits into
sudipnext:mainfrom
Bruce-anle:fix/header-footer-relationships
Open

Fix relationships for markdown headers and footers#7
Bruce-anle wants to merge 2 commits into
sudipnext:mainfrom
Bruce-anle:fix/header-footer-relationships

Conversation

@Bruce-anle
Copy link
Copy Markdown

Summary

  • load header-specific and footer-specific relationship files while parsing those parts
  • resolve hyperlinks from word/_rels/header*.xml.rels
  • resolve images from word/_rels/footer*.xml.rels
  • add focused tests for header hyperlinks and footer images

Why

Header and footer parts have their own relationship files. Using only word/_rels/document.xml.rels means hyperlinks and images inside headers/footers cannot resolve.

Dependency

This PR is stacked on #5 because header/footer roots must first be converted by the markdown parser. If #5 is merged first, this PR can be rebased to show only the relationship changes.

Tests

  • /home/brucean/doc4agent/.venv/bin/python -m pytest tests -q -p no:cacheprovider

Bruce-anle added 2 commits May 9, 2026 00:52
Background: convert_to_markdown reads word/header*.xml and word/footer*.xml, but passed w:hdr/w:ftr roots to parse_body_to_markdown. That parser only looked for w:body, so header/footer content was skipped.\n\nChanges: allow parse_body_to_markdown to traverse w:hdr and w:ftr roots directly while preserving normal w:document/w:body behavior.\n\nVerification: /home/brucean/doc4agent/.venv/bin/python -m pytest tests -q -p no:cacheprovider passed.
Background: header and footer parts have their own relationship files. The markdown converter parsed header/footer XML but still used document.xml relationships, so header/footer hyperlinks and images could not resolve.\n\nChanges: load word/_rels/header*.xml.rels and word/_rels/footer*.xml.rels while parsing each header/footer part.\n\nVerification: /home/brucean/doc4agent/.venv/bin/python -m pytest tests -q -p no:cacheprovider passed.\n\nNote: this branch is stacked on the header/footer markdown parsing fix.
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