-
Notifications
You must be signed in to change notification settings - Fork 130
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
Inline placeholder image causes other normal images to be replaced #150
Comments
What seems to be happening here is that, when the placeholder image is inline with the tags, the start_field and end_field end up within the same The solution seems to be to update the
However, this code is used by multiple other |
Interesting I thought I fixed the inline replacement problem in #131 but hopefully I'll have time later this week to look into it further. |
Thanks. I just realized there's another case that my proposed fix doesn't address - if there is another inline image preceding the placeholder image in the same paragraph. I think what's really needed is a more robust algorithm to walk the xml tree and pick only the nodes that are actually between the start and end nodes, in document order. I'm not sure exactly what that would look like yet, but I think some sort of modified depth first search traversal might do the trick. This seems like it would be a common problem when parsing open office xml documents, perhaps there is a well known algorithm that can be reused. |
Hi guys, I am also facing this issue. |
When you have an inline placeholder image to be replaced (i.e. within image replacement fields), other non-placeholder images in the document after the placeholder image can end up being replaced along with the placeholder image.
For example:
Template:
Expected:
Actual:
Attached is a modified images_template.docx that demonstrates the issue as shown above:
images_template.docx
The text was updated successfully, but these errors were encountered: