Giter VIP home page Giter VIP logo

go-quilljs-delta's People

Contributors

fmpwizard avatar xxuejie avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

go-quilljs-delta's Issues

Using compose on multi-line documents results in: runtime error: slice bounds out of range

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));
})

Chinese charset issue

From an email report:

when I do compose, the string contain Chinese “你好,世界!“。then I delete the whole string, but only delete “你好,“ ,

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.