Skip to content

Conversation

jenstroeger
Copy link
Contributor

@jenstroeger jenstroeger commented Oct 29, 2020

This helper function is useful to check whether the cursor is currently inside of a certain element. For example, within links I want to ignore split and linefeed events:

      if (cursor.getParentContainer('A')) {
        return;
      }

@peyerluk, I think you had implemented a similar function in PR #99 regarding links and not wanting to wrap a link in a link. This PR might support yours?

@jenstroeger
Copy link
Contributor Author

@peyerluk, I rebased on yesterday’s master.

@jenstroeger
Copy link
Contributor Author

I removed the getParentContainer() function, and this PR now contains only the hoisted functions in a single commit.

@jenstroeger jenstroeger changed the title Add getParentContainer() helper function to cursor. Hoist helper functions from Selection into Cursor class. Jul 1, 2021
@peyerluk peyerluk merged commit 8e42af7 into livingdocsIO:master Jul 1, 2021
@livingdocs-automation
Copy link
Collaborator

🎉 This PR is included in version 2.10.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@jenstroeger
Copy link
Contributor Author

@peyerluk, @marcbachmann, when hoisting these three methods from Selection to Cursor I forgot to adjust the comments, e.g. “Get all tags that affect the current selection.” I think that should be “Get all tags that affect the current cursor or selection.”. Do you care, then I’ll add another PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants