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

Is it possible to skip certain HTML tags? #27

Open emielvangoor opened 8 years ago

emielvangoor commented 8 years ago

When I diff a new text with <!DOCTYPE html ...>, bodyor head tag and the old text doesn't include these the HtmlDiffwill add a class="diffmod" to the tag, is there anyway to avoid/skip these kind of tags?

jschroed91 commented 8 years ago

Hi Emiel, there is currently no way to skip them.

I will be working on updates for table diffing over the next week, so I will be sure to make some time to include a feature that allows you to skip/ignore certain tags.

A workaround for now might be to preprocess the text before sending it into HtmlDiff to remove those tags.

emielvangoor commented 8 years ago

OK, thanks for the reply Josh!

jschroed91 commented 8 years ago

@emielvangoor Just an update - have not gotten to this yet but it's on my radar. I will aim to get this feature included in the next release - probably 1-2 weeks.

emielvangoor commented 8 years ago

@jschroed91 Thanks for the update..! For now I created a simple preprocessor to remove the tags as you suggested. Would be great if you implement this feature in the library.. :+1:

jschroed91 commented 5 years ago

This has been de-prioritized, and currently not sure if I have plans to implement this in the near future, since the focus of this library is on HTML snippets. However, I'm not against handling this so that it's compatible with full html documents