fmpwizard / go-quilljs-delta Goto Github PK
View Code? Open in Web Editor NEWLicense: Apache License 2.0
License: Apache License 2.0
This looks like a pretty nice way to edit documents.
What front end did you use ?
First of all, thank you for creating this library, it saved me quite a few hours. I'm having a few problems with composing deltas, mainly with multi-line documents.
Steps to reproduce:
Given the original delta:
{"ops":[{"insert":"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin tempus ex at hendrerit pretium. Sed feugiat tempus leo, eu placerat nibh ullamcorper id. In non vulputate sapien. Suspendisse laoreet ultricies elementum. Aliquam magna augue, varius id massa in, sagittis placerat velit. Vestibulum ut mi a erat congue feugiat. Donec sed mauris sed lacus feugiat fermentum. Etiam molestie convallis lorem eget venenatis. Curabitur imperdiet ante maximus eleifend convallis. In fermentum sem a bibendum auctor. Vivamus pharetra quis nibh sed accumsan. Aliquam gravida, justo eget accumsan semper, ex elit sagittis enim, ut consectetur magna est at justo."},{"insert":"\n","attributes":{"align":"justify"}},{"insert":"Quisque sagittis, magna at semper euismod, erat ex viverra velit, a hendrerit augue felis vel nulla. In porta leo ac arcu pharetra, et cursus sapien feugiat. Cras sed facilisis tellus. Vivamus hendrerit posuere condimentum. Curabitur laoreet enim quam, eget porta sem pharetra ut. In eleifend lorem a nulla pulvinar, eu mollis dolor sodales. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas."},{"insert":"\n","attributes":{"align":"justify"}},{"insert":"\n"}]}
The patch
{"ops":[{"retain":872},{"insert":"s"}]}
Running original.Compose(patch)
results in runtime error: slice bounds out of range
test/vendor/github.com/fmpwizard/go-quilljs-delta/delta.(*Iterator).Next(0xc4205e1180, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0) /home/claudiu/go/src/test/vendor/github.com/fmpwizard/go-quilljs-delta/delta/iterator.go:69 +0x2f9 test/vendor/github.com/fmpwizard/go-quilljs-delta/delta.(*Delta).Compose(0xc42011ca60, 0xc4208fa180, 0x2, 0x4, 0xc42011cbe0) /home/claudiu/go/src/test/vendor/github.com/fmpwizard/go-quilljs-delta/delta/delta.go:216 +0x5f5
LE: I'm trying to mimic the functionality of updateContents in Quill. The two deltas were the result of this:
quill.on('text-change', (delta, oldDelta, source) => {
console.log(JSON.stringify(delta), JSON.stringify(oldDelta));
})
line 661 and 669 of delta_test.go
From an email report:
when I do compose, the string contain Chinese “你好,世界!“。then I delete the whole string, but only delete “你好,“ ,
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.