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

Get position of the pressed button in the inline JS #414

Closed
3 tasks done
ujikol opened this issue Sep 16, 2024 · 8 comments
Closed
3 tasks done

Get position of the pressed button in the inline JS #414

ujikol opened this issue Sep 16, 2024 · 8 comments
Labels
feature request New feature or request

Comments

@ujikol
Copy link

ujikol commented Sep 16, 2024

Please fill out these Check-boxes

  • I checked for existing similar feature requests
  • I have read the docs and checked that the feature I am requesting is not already implemented
  • My feature request consists of only one feature

Is your Feature Request related to a Problem or Annoyance?

No response

Describe the Feature you'd like

I need to process the text in the context of the button, e.g. the markdown section below the button.
For that I need to know the buttons line or offset.
The editors cursor might be somewhere else.

Alternatives

At least get the ID of the button. But would be off much less help because duplicating section with related buttons would lead to non-distinguishable IDs.

Additional Context

No response

@ujikol ujikol added the feature request New feature or request label Sep 16, 2024
@mProjectsCode
Copy link
Owner

mProjectsCode commented Sep 16, 2024

Getting line numbers and positions of inline elements is not possible in reading mode, which is a limitation of the Obsidian API.

@ujikol
Copy link
Author

ujikol commented Sep 16, 2024 via email

@mProjectsCode
Copy link
Owner

what exactly do you mean by output? The HTML element of the button? You should never modify that.

@ujikol
Copy link
Author

ujikol commented Sep 16, 2024 via email

@ujikol
Copy link
Author

ujikol commented Sep 19, 2024 via email

mProjectsCode added a commit that referenced this issue Sep 21, 2024
@mProjectsCode
Copy link
Owner

In the next version of the plugin you can access some extra information about the button including its location (if known) via context.buttonContext

@ujikol
Copy link
Author

ujikol commented Sep 21, 2024 via email

@mProjectsCode
Copy link
Owner

No. When it's ready. A canary release will come tomorrow, if you can't wait.

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

No branches or pull requests

2 participants