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

Fix insert inline embed with delete before block embed #2882

Conversation

tzyl
Copy link
Contributor

@tzyl tzyl commented Dec 23, 2019

Fixes #2874

  • Use same approach as fix insert text before block embed #2278 to consume next new line when inserting inline embed before a block embed to ensure index calculations for the delete are not off by one due to implicit newline being added

This fix requires the delta to explicitly specify the implicit newline that gets added as part of the new block container that the inline embed is created inside. If not explicitly specified, the internal index tracking will be off by one and the delete will consume the implicit newline instead. (which is the current behaviour)

This fix requires the delta to explicitly specify the implicit newline
that gets added as part of the new block container that the inline embed
is created inside. If not explicitly specified, the internal index
tracking will be off by one and the delete will consume the implict
newline instead.
@tzyl tzyl requested a review from jhchen January 15, 2020 18:05
@koibi2
Copy link

koibi2 commented Jun 5, 2020

@jhchen
This branch needs to be merged.
This is useful.

@tzyl
Copy link
Contributor Author

tzyl commented Jun 30, 2020

Hey @jhchen @luin it would be really useful for me to have this fix merged, any chance you can take a look please?

@jhchen jhchen merged commit 58b1747 into slab:develop Aug 13, 2021
@jhchen
Copy link
Member

jhchen commented Aug 13, 2021

Sorry took a while to review but looks all correct -- thank you for the PR

DokaRus pushed a commit to DokaRus/devextreme-quill that referenced this pull request Oct 28, 2021
…-block-embed-with-delete

Fix insert inline embed with delete before block embed

(cherry picked from commit 58b1747)
DokaRus added a commit to DevExpress/devextreme-quill that referenced this pull request Oct 29, 2021
* Merge pull request slab#2882 from tzyl/fix/insert-inline-embed-before-block-embed-with-delete

Fix insert inline embed with delete before block embed

(cherry picked from commit 58b1747)

* use Op.length

(cherry picked from commit 738a196)

* add failing tests

(cherry picked from commit a02978f)

* track all implicit newline indexes and shift for delete

(cherry picked from commit cf101f6)

* add test for tracking indexes between insert/delete

(cherry picked from commit 50dbbed)

* add fix and failing test for implicit newline insertion

(cherry picked from commit 99bfdcd)

* fix linter

(cherry picked from commit 7e98bc2)

* prefer file over html when uploading

- file should include the image data
- copying image from slack will include both, but image src is
  inaccessible without login

(cherry picked from commit e164f12)

* fix mixed html/file test and handle image only case

(cherry picked from commit ead3355)

* fix formatting

* tiny refactoring

Co-authored-by: Jason Chen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Delete block embed together with inserting inline embed does not work
3 participants