Comments (4)
Could you provide some details on what this would do? I'm not sure how this concept to integrate with unified diffs, etc.
from jsdiff.
Thanks for your concern.
The output of jsdiff includes removed, added and unchanged state to describe the kinds of change in the text. For example, original text: aab, new text: aac. In diffChars mode, jsdiff will return [{value: "aa"}, {value: "b", remove: true}, {value: "c", added: true}]. In general purpose, it is good enough. But I want the result to be more useful. I want to know that the b in the original text "aab" is replaced with c in the new text "aac".
If it is not clear enough, the output of myersdiff.py maybe helpful. Take the previous example. The outputs of myersdiff.py are [('equal', 0, 2, 0, 2), ('replace', 2, 3, 2, 3)]. To print this result, please download the python file by the link in my first post. Paste the two line codes below at the bottom of the file myersdiff.py. Please make sure there is no leading space in the two additional line.
differ = MyersDiffer("aab", "aac")
print list(differ.get_opcodes())
from jsdiff.
👍
I'm looking for something like that.
A working example of this could be: http://cemerick.github.io/jsdifflib/demo.html
from jsdiff.
Wonder why closed? :)
from jsdiff.
Related Issues (20)
- Race condition with this.options in async mode?
- diffJson throws on `Object.create(null)` in some cases
- Failed to resolve entry for package "diff". The package may have incorrect main/module/exports HOT 3
- [HELP] Different result when changing order of parameters? HOT 6
- `oneChangePerToken` option removed? HOT 1
- unexpected diffchars result HOT 3
- At the end of the compared text, when there is a punctuation mark, something goes wrong HOT 1
- Performance improvement suggestion
- Shadcn installation error : Error Module not found HOT 2
- Getting text dif with line numbers HOT 1
- A simple few-line example of what to import? HOT 1
- Non-Minimal Array Diff with Emtpy Lines at End HOT 1
- parsePatch chokes on some valid patches HOT 1
- Diffword function is no longer able to find similar excerpts already found when I add text HOT 1
- Adding "merge" flag to all diffMethods improve diff readability
- Bug w/ `createPatch()` when modifying file ending without new line
- v5.2.0 on npm doesn't have oneChangePerToken HOT 1
- Check applyPatch handling of case where both old and new file have no trailing newline HOT 1
- SyntaxError: Unexpected identifier 'assert' during Grunt buld HOT 1
- createPatch always show second file at the end instead of the beginning with html2diff
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.