Problem statement: Two input string with styling like strong,li,ol,line-through etc in HTML. In the screen, there should be two box : Original Text & Edited Text. If any text of original Text is missing in Edited Text then it should highlight that word in red colour. If he has added anything in Edited Text which is not in Original Text, then it should highlight that text in yellow colour in Edited Text
Expected Output: In first box it should highlight the deleted text in red colour & In second box it should highlight the edited text in yellow colour
Solution Tried: : 1> Tried with DIff Match Patch but not working properly as my input string contains html string. I can't strip the tags as it will lose its styling.
2> Tried with HtmlDiff but this is giving both deleted word & modified word in a single string. Very difficult to modify this library.
Any lead or help will be much appreciated. Thank you


It may be easier for you to manually compare the strings of HTML code by splitting the text into string arrays (split by char ' ').
For example, for part 1 of your problem, you could compare words (string arrays) and add in a span with class highlightRed to make the background red.
Example: https://codepen.io/vck3000/pen/xYeLKq/?editors=1111
Part 2 (highlight yellow) would be a similar task, but slightly harder. See if you can figure it out.