-
Notifications
You must be signed in to change notification settings - Fork 103
Description
I have a problem where I want to merge three version of html together.
let originalHtml = "<p>one</p><p>two</p><p>three</p>"; let unsafedHtml = "<p>one</p><p>two</p><p>unsafed</p><p>three</p>"; let incomingHtml = "<p>one</p><p>incoming</p><p>two</p><p>three</p>";
Unsafed HTML are changes made by the user in an editor and incomingHtml comes from an external event.
I can diff originalHtml -> unsafedHtml. Now, I want to apply this diff to incoming HTML but I believe because incomingHtml has a new node I can't just apply the unsafedDiff to incomingHTML.
Does someone has an idea how to do it,
The README says
This diff is non-destructive, meaning that relocations of DOM nodes are preferred over remove-insert operations.
I believe this makes diff merging harder