Comments (12)
from jsdiff.
+1 for feature.
Just leaving a note here, the HTML support requested appears to be in essence a tree based diff algorithm which is wildly different from a text-based diff.
There is a relatively old project which does this for xml https://github.com/fdintino/xydiff, I have not searched a long time but perhaps there are newer or even better open-source solutions available.
Perhaps an investigation into it could lead to the feature. Not sure how it can incorporated though.
from jsdiff.
Any updates on this? @kpdecker
from jsdiff.
+1 for HTML support.
from jsdiff.
are there any updates on this issue? can someone find a workaround?
from jsdiff.
@unkw I need more explanation. For the input above, what do you want it to return as the changes?
from jsdiff.
I expect the output as:
- "production" as insert
- "javascript" as modified (since changed the tag)
from jsdiff.
How are you trying to use this? Just saying "javascript" because the tag changed without providing any information about what the tag that changed was does not seem very useful.
from jsdiff.
We have rich text editor. User can change text in editor, can change font from Bold to Italic. And i need show diff what was deleted in the text, what was modified or inserted.
from jsdiff.
@kpdecker will it be possible to realize it?
from jsdiff.
This is a non-trivial thing to implement as it requires more knowledge of the structure of the document than the text focused diff algorithm implemented here allows for. I'm not certain that the algorithms here are good candidates for this as they are currently implemented. That's to say that this won't be implemented in the immediate term but leaving this open to revisit if I or any members of the community have time. I'm glad to accept pull requests that tackle this feature.
from jsdiff.
@kpdecker I agree, this is not a trivial task. Thank you for the feedback and this nice library ;)
from jsdiff.
Related Issues (20)
- Can't import files in `lib/`
- diff for large arrays never returns and uses 100% CPU forever HOT 2
- Treat CRLF as one character (config option) HOT 1
- Incorrect return value for structuredPatch method HOT 1
- Special characters in word is accounted as a separate word HOT 1
- Diff.diffChars is not a function HOT 2
- Diiff.js File Missing HOT 3
- Endless loop + hang with 100% CPU usage in execEditLength() when calling structuredPatch()
- "Full Online Demo" Link is broken - 404
- ChainAlert: npm package release (5.1.0) has no matching tag in this repo HOT 1
- HTML in text handling error? HOT 2
- v5.1.0 tag missing HOT 1
- diffLines never returning HOT 1
- Does jsdiff work with Chinese (or other non-English script languages)? HOT 5
- [BUG?] incompact seperate logic when same character HOT 1
- Context option not working? HOT 1
- diffLines adding extra addition/removal HOT 2
- Line diff apply giving extra line in the end when source is empty string HOT 9
- JSDiff treats HTML content as a single line if there is no EOL at each line HOT 4
- [question] Is it possible to preserve the whitespace when using `ignoreWhitespace` ? It breaks the formatting HOT 2
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 jsdiff.