Good time, friends.
You need to compare two versions of the text. The text is the html markup
. This can be done either php or js, whatever. Tried using prettyTextDiff
, which is a wrapper for google_diff_match_patch.js
but he can only work with pure text. Crutches and-so's mother begged him to work with markup, but it is terribly responsive. For example, if the text will be replaced by ul to ol, then displays uo. And here all the trouble. Found no adequate solutions, check the length of the remote/attached (>3 characters, for example) line breaks everything.
Here people faced with the same problem: a Click
, so I will take from his example:
Mom soap frame.
It was not tuch the sky.
My mother washed poodle.
In the sky were clouds.
<h1><span class=old>Title</span> <span class=new>Name</span><h1>
Mom soap <span class=old>frame</span> <span class=new>poodle</span>.
<span class=old>Not tuch the sky.</span>
<span class=new>In the sky were clouds.</span>