rashid2538 / php-htmldiff

A library for comparing two HTML files/snippets and highlighting the differences using simple HTML.
GNU General Public License v2.0
69 stars 48 forks source link

Problem when part of text in anchor is taken out of anchor tag #4

Open rayrigam opened 11 years ago

rayrigam commented 11 years ago

I took a quick look at your demo and tried a few different string changes and noticed the following issues: 1) When taking out text that was inside an anchor tag, the text that was taken out shows up in the compared html inside an anchor tag of its own rather than showing up with no anchor tag. For instance, when going from $html1 = Check <a href="http://google.com">this out</a>. to $html2 = Check <a href="http://google.com">this</a> out. 2) When putting text that was outside of an anchor into an anchor (the opposite to the above example), the text that is now inside the anchor still shows up outside the anchor in the comparison html. 3) Any change to the href or other attributes of an anchor is not indicated in any way in the comparison html. The most appropriate behavior would be to show the entire anchor element twice; first, the original anchor element inside a "del" tag, and second, the modified one inside an "ins" tag.