| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
- Added WML_TEMPLATE_MAIN content type constant - Updated Document() to accept both .docx and .dotx files - Added part factory mapping for template content type - Added tests for .dotx template loading - Fixes python-openxml#1532
| Back | FazBrowse Home | New Git URL |
Description
Fixes #1532.
Adds support for loading Word template files (.dotx) with python-docx.Document().
Problem
Loading a .dotx file currently raises a ValueError due to an unsupported content type. Even if bypassed, the part factory creates a generic Part instead of DocumentPart, causing an AttributeError.
Solution
Treat .dotx templates the same as .docx documents, which matches the OOXML spec.
Changes:
Testing