Replace dot with underscore in HTML name #229
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I used
docx-templates
to generate a Word document with embedded HTML (altchunks). I was unable to open the document using Docx4j. The following error was reported:After unzipping the Word document, I noticed there were a bunch of files in the
word
folder that were named like this:Since each file name contained two dots in it, I renamed them by replacing the first dot with an underscore:
After renaming the files, I zipped up the folder, and was then able to open the Word document in Docx4j.
This pull request contains a single line of code to ensure the first dot in the HTML file name is replaced with an underscore. Not sure if the file names could end up with multiple dots, so a regex global replace would probably be a better solution.