Skip to content

Conversation

@damienfa
Copy link
Contributor

Description

This PR fixes an issue where the replaceXmlBlock() method only searched for and replaced macros in the main document part, ignoring headers and footers.

Fixes # (issue)

The replaceXmlBlock() method was limited to replacing XML blocks only in tempDocumentMainPart. When templates contained macros in headers or footers that needed to be replaced with complex XML blocks (such as images, charts, or formatted content), these replacements would silently fail.

This change brings replaceXmlBlock() in line with other replacement methods like setValue() and setImageValue(), which already search across all document parts. This ensures consistent behavior across the API and allows users to replace complex content in headers and footers, which is a common requirement when working with Word templates.

Checklist:

  • My CI is 🟢
  • I have covered by unit tests my new code (check build/coverage for coverage report)
  • I have updated the documentation to describe the changes
  • I have updated the changelog

…ace in headers, footers, in addition to the main content
@damienfa damienfa closed this Dec 22, 2025
@damienfa damienfa deleted the pr-templateprocesor-shiould-replace-footer-and-headers-too branch December 22, 2025 23:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant