Skip to content

fix: Ensure necessary namespaces are in patched doc #2698

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jan 6, 2025

Conversation

joshkel
Copy link
Contributor

@joshkel joshkel commented Jul 3, 2024

Word for the web, for example, may generate .docx files with a very limited set of XML namespaces:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<w:document xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main">

Using one of these files as the template / source for a docx.js patch may result in errors from missing namespaces.

To fix this, I added the handful of namespaces that appear to be needed by docx.js's elements. It may be better to include the full set of namespaces from the Document class. If you'd prefer I do that, please let me know.

I did some refactoring to simplify this and to cut down on duplicate namespace references. If you'd prefer I handle this differently, please let me know.

Fixes #2697

@dolanmiu
Copy link
Owner

Seems good, need to make the CI to start. Unsure why it isn't starting

@dolanmiu dolanmiu self-requested a review November 20, 2024 10:59
Copy link

codecov bot commented Jan 6, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (e80a50d) to head (6109e42).
Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##            master     #2698   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          286       286           
  Lines         8370      8363    -7     
  Branches      1400      1409    +9     
=========================================
- Hits          8370      8363    -7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dolanmiu dolanmiu merged commit ff37f3b into dolanmiu:master Jan 6, 2025
8 checks passed
@joshkel joshkel deleted the patch-xmlns branch January 6, 2025 22:39
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.

"Word experienced an error" from missing xmlns
2 participants