Comments (3)
@maliayas Thanks for opening this issue!
This is actually an undesired side-effect of one of the newer features we implemented - isolated tag diffing. I had not actually thought about this until now, so I'm very glad you opened this issue.
Basically, the isolated tag diffing is comparing the italic tags emergency escape and rescue openings
separately from the rest of the content - this is to fix a lot of the issues we had with the diff output not protecting the HTML structure.
The issue here is that in order to diff them in isolated, we actually replace the entire tag with a placeholder "word" before we diff the content. The diffing algorithm is not aware of the length of the string that the placeholder represents, and therefore sees it as 1 word, and in this case it is finding a longer match in shall be
than it is in the placeholder match.
So, it will take a little of work, but is certainly possible. This will be one of the higher priorities to tackle.
from php-htmldiff.
I see. Great explanation. If fixing this, will break other stuff, don't worry about this issue. I understand that perfecting a diff library may be quite complex.
Btw. demo tool is awesome.
from php-htmldiff.
Looping back around here - our highest priority of this library was the accuracy of the diff, so unfortunately performance took a back seat to it. However, we do like to leave that decision up to the end users when we can - the config option setIsolatedDiffTags
is used to define which tags are diffed in isolation, and currently the defaults include i
and em
tags.
I'll see if I can update the documentation to highlight the reasoning behind choosing this as the default option this weekend.
Closing this issue.
from php-htmldiff.
Related Issues (20)
- Lists being marked as changed when the output is 100% the same. HOT 3
- Some diffs take far too long even with no multi-byte HOT 10
- Individual Element Styling is Removed HOT 1
- Warning DOMDocument::loadHTML(): Unexpected end tag : strong HOT 3
- How about some sample output to demonstrate before downloading? HOT 1
- Spaces near quotes etc. HOT 5
- Diff fails on image as a link inside a table
- no iframes in result HOT 2
- nested/unclosed tags on attribute differences
- Add placeholder for the HTML5 <picture> element.
- HTML entities are not kept intact, leading to invalid HTML
- Offer diff by characters
- Warning: DOMDocument::loadHTML(): Unexpected end tag : u in Entity HOT 2
- Rowspan Colspan issue in differense
- Handling HTML entities via mbstring is deprecated in PHP 8.2 HOT 3
- TableDiff: Deprecated function mb_convert_encoding() in PHP 8.2
- list flattening
- You're amazing ❤
- Problem with Match in PHP8 HOT 4
- How to ignore changes in an attribute? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from php-htmldiff.