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 inline embed insertions with applyDelta() #3793

Merged
merged 2 commits into from
Jun 15, 2023
Merged

Conversation

luin
Copy link
Member

@luin luin commented Jun 6, 2023

This PR fixed two bugs related to inserting inline embeds caught by #3789. See test cases and comments for details.

core/editor.ts Outdated
const [leaf] = this.scroll.leaf(index);
const formats = merge({}, bubbleFormats(leaf));
// @ts-expect-error
const [leaf] = this.scroll.descendant(LeafBlot, index);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For <p>a<strong>b</strong></p>, this.scroll.leaf(1) returns "a" whereas this.scroll.descendant(LeafBlot, index) returns "b". The latter represents the target position of the insert so changing to that.

@luin luin force-pushed the zh-inline-embed-bug branch 3 times, most recently from 92a090c to ded4666 Compare June 7, 2023 01:47
@luin luin requested a review from jhchen June 7, 2023 02:19
@luin luin marked this pull request as ready for review June 7, 2023 02:19
@luin luin merged commit c8dec17 into develop Jun 15, 2023
8 checks passed
@luin luin deleted the zh-inline-embed-bug branch June 15, 2023 01:36
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.

None yet

2 participants