caxy / php-htmldiff

A library for comparing two HTML files/snippets and highlighting the differences using simple HTML. Includes support for comparing complex lists and tables
http://php-htmldiff.caxy.com
GNU General Public License v2.0
202 stars 51 forks source link

Bugfix Adding class crippled HTML in selfclosing tags #97

Closed SavageTiger closed 3 years ago

SavageTiger commented 3 years ago

When a diffmod class was added to a self-closing tag (in the tests mostly <br />) it naively added the class attribute by replacing the closing bracket, this resulted in <br / class=“diffmod”> which is invalid HTML.

Some tests actually had this mistake hidden in the results making it easy to replicate and fix the issue.