Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

JavaScript library to Merge HTML files

Our team has an email generator that generates HTML Emails based on a number of parameters. The user just has to check/uncheck boxes and the email gets regenerated.

Sometimes, the user has to slightly alter the content of the email manually.

Problem is, if the email content is altered manually, and then the user changes the parameters again, all his manual modifications are overriden.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

I would like to be able to merge his modifications into the new generated HTML Email.

So what I have is:

  • Email 1: Generated by the system based on a few parameters
  • Email 1 + slight manual modifications
  • Email 2: Generated by the system based on slightly different parameters than Email 1 (Resembles to Email 1 in every aspect except a sentence that was deleted or added)

How can merge the user modifications that user applied in Email 1 into Email 2 using a Javascript library.

>Solution :

Try using a library like diff-match-patch or js-diff to compare the two HTML emails and merge the modifications from email1 into email2

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading