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

fix: #198 WordML MergeFields remove parent and crashes if multiple fields share parent #199

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Amnesthesia
Copy link

We use SyncFusion Document Editor to edit documents and perform MailMerge operations, which we process on our backend with Sablon.

Occasionally, we have errors thrown when users have put mergefields on the same line as another merge field, particularly if those mergefields insert WordML such as tables or images.

This seems to happen because Sablon::Content::WordML removes the parent, expecting only one WordML variable per parent paragraph.

I made a ticket on this but thought I'd try to to be helpful and propose a fix, which is to insert a new paragraph as the previous sibling to the existing paragraph, then replace that paragraph with the variable instead, ensuring that it never removes a paragraph unless the mergefield is the last mergefield of that paragraph

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.

1 participant