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

feat: add extendEmptyMarkRange option to mark commands #1859

Merged

Conversation

philippkuehn
Copy link
Contributor

@philippkuehn philippkuehn commented Sep 8, 2021

This PR adds an option extendEmptyMarkRange to the unsetMark and toggleMark commands. This defaults to false now (until now it was true). This option is useful for the link mark, to remove a link even if there is an empty selection but it’s rather confusing for other marks.

Thanks for @isubasti for the main idea (#1650).

@philippkuehn philippkuehn merged commit 14e458e into main Sep 8, 2021
@philippkuehn philippkuehn deleted the feature/add-extendEmptyMarkRange-option-to-mark-commands branch September 8, 2021 07:32
@isubasti
Copy link

isubasti commented Sep 8, 2021

Hi @philippkuehn thanks for this. Though there is one more corner case on this one but haven't got a chance to think about it. it's for things like two link marks that are next to each other with different attrs then if the empty selection is on the first one then only the first one should be removed instead of removing mark for both.

@philippkuehn
Copy link
Contributor Author

ah you are right! will look at this later! (we just need to pass the current mark attributes to getMarkRange)

@philippkuehn
Copy link
Contributor Author

should be fixed with this patch.

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