Skip to content
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

docx v.6.0.0 -- using the table options and style.xml simultaneously #842

Closed
tadmi opened this issue Mar 21, 2021 · 5 comments · Fixed by #844
Closed

docx v.6.0.0 -- using the table options and style.xml simultaneously #842

tadmi opened this issue Mar 21, 2021 · 5 comments · Fixed by #844

Comments

@tadmi
Copy link
Contributor

tadmi commented Mar 21, 2021

Thank's for the release of DOCX v.6.

There is a problem when I apply together options and custom-style.xml to the table.
2021-03-21_200849

Word removes options on first launch.
In the image before and after the first run of the created file:
2021-03-21_201105

If you manually move the "w:tblStyle" tag to the first place before the first file launch, the options are not removed:
2021-03-21_201427

Please change the order of adding tags to document.xml:

let the tag "w:tblStyle" be the first one when using the table options and style.xml simultaneously.

@dolanmiu
Copy link
Owner

I will make this fix, but it works fine on my version of Word (MacOS)

Demo 25:

Screenshot 2021-03-22 at 05 42 02

If Word does indeed alter the Word document, when I try to close it, it should surely prompt me with a "Unsaved changes dialog"? But it does not do so

dolanmiu added a commit that referenced this issue Mar 22, 2021
@dolanmiu
Copy link
Owner

I have made a PR, can you confirm if this branch fixes the issue?

Then I will release 6.0.1

#844

@tadmi
Copy link
Contributor Author

tadmi commented Mar 22, 2021

Yes, after the fix it works correctly:

applied to the table options and style from custom-style.xml are saved after the first opening of the file generated by docx.js.

@tadmi
Copy link
Contributor Author

tadmi commented Mar 22, 2021

MS Word significantly transforms the internals of a docx file (generated by DOCX.JS) when first opened. And It does not offer to save the changes.

It is possible to track changes using the extension for VS Code - OOXML Viewer.

The image shows a fragment document.xml:
2021-03-22_105941

@tadmi tadmi changed the title docx v.6 -- using the table options and style.xml simultaneously docx v.6.0.0 -- using the table options and style.xml simultaneously Mar 22, 2021
dolanmiu added a commit that referenced this issue Mar 22, 2021
@dolanmiu
Copy link
Owner

I have applied the fix, will release 6.0.1 later today

Thanks for working with me through this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants