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

Improve behavior when using insertContent #2147

Merged
merged 4 commits into from Nov 8, 2021

Conversation

philippkuehn
Copy link
Contributor

@philippkuehn philippkuehn commented Nov 8, 2021

With this PR we try to improve the behavior of insertContent in some cases.

  1. When content is inserted into an empty text block, we try to replace the text block instead of inserting the content after the text block. This prevents empty paragraphs for example.
  2. After inserting, the cursor is placed at the end of the inserted content instead of after it (fix Incorrect insert of custom node before same custom node #1673)
  3. Prevent multiple nodes after inserting a horizontal rule to an empty document (see HorizontalRule extension: inconsistent behavior #1964)
  4. Fix error when inserting horizontal rule at the end of the document (fix horizontal-rule extension throws "RangeError: Position x out of range" #2117)

@philippkuehn philippkuehn changed the title Improve cursor behavior when using insertContent Improve behavior when using insertContent Nov 8, 2021
@philippkuehn philippkuehn merged commit 8fc915c into main Nov 8, 2021
@philippkuehn philippkuehn deleted the feature/improve-insertcontent-behavior branch November 8, 2021 19:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant