php-htmldiff
php-htmldiff copied to clipboard
Is it possible to skip certain HTML tags?
When I diff a new text with <!DOCTYPE html ...>
, body
or head
tag and the old text doesn't include these the HtmlDiff
will add a class="diffmod"
to the tag, is there anyway to avoid/skip these kind of tags?
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.
OK, thanks for the reply Josh!
@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 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:
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