Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updateContents(delta) adds additional new line and breaks OT #741

Closed
benbro opened this issue Jun 8, 2016 · 1 comment
Closed

updateContents(delta) adds additional new line and breaks OT #741

benbro opened this issue Jun 8, 2016 · 1 comment

Comments

@benbro
Copy link
Contributor

benbro commented Jun 8, 2016

Sometimes an additional \n is added when applying a delta with quill.updateContents(delta).

Steps for Reproduction

  1. Visit http://beta.quilljs.com/
  2. Paste this in the console:
quill.setContents([{insert: "ab\nc"}, {insert: "\n", attributes: {list: 'ordered'}}]);
quill.updateContents([
  {retain: 1},
  {delete: 3},
  {retain: 1, attributes: {list: "ordered"}}
]);
quill.getContents();

Expected behavior:

[{insert:"a"},{insert:"\n",attributes:{list:"ordered"}}]

Actual behavior:

[{insert:"a"},{insert:"\n\n",attributes:{list:"ordered"}}]

Platforms:
Firefox 47 on Windows 7

Version:
1.0-beta.4

@benbro
Copy link
Contributor Author

benbro commented Jun 20, 2016

Verified that the fix work in 1.0 head.
Thanks

@jhchen jhchen closed this as completed in e5651c6 Jun 20, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants