php-htmldiff icon indicating copy to clipboard operation
php-htmldiff copied to clipboard

Is it possible to skip certain HTML tags?

Open emielvangoor opened this issue 9 years ago • 5 comments

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?

emielvangoor avatar Feb 12 '16 15:02 emielvangoor

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.

jschroed91 avatar Feb 12 '16 15:02 jschroed91

OK, thanks for the reply Josh!

emielvangoor avatar Feb 12 '16 16:02 emielvangoor

@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.

jschroed91 avatar Mar 14 '16 17:03 jschroed91

@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:

emielvangoor avatar Mar 14 '16 18:03 emielvangoor

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

jschroed91 avatar Feb 23 '19 08:02 jschroed91