title: Detecting/Tracking changes in Text Editor via Jquery
body: <p>I have implemented a text editor in a page. I am displaying some text (each segment/line is enclosed in p tag) from the database in the text editor. What I want to do is when somebody makes changes to the text like adding new line, modifying an old line or deleting a line I want to retrieve that line and update it in the database. I need the line position (so I can insert/replace that line after some operations on it) and status (insert/delete/modify) so I can do some operations on that line and then store it back in DB. I tried doing it on server/backend (php) side but was unsuccessful. What I did was to get the old text and the new text (after inserting/delete/modify) and splitting them on p tag so I get the number of lines, then compare with old text (also split on p tag). The problem with that was I was unable to distinguish between new lines and modify leading to duplication of lines. I am at a dead end now, any help will be kindly appreciated.</p>