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

Perform Action on internal links [](#header) #37

Open
graphit0 opened this issue Feb 1, 2022 · 2 comments
Open

Perform Action on internal links [](#header) #37

graphit0 opened this issue Feb 1, 2022 · 2 comments

Comments

@graphit0
Copy link

graphit0 commented Feb 1, 2022

Description

When "performing action" on a short internal link [](#header), instead of focusing on the # header, it prompts to open a new window of a browser.

Steps

  1. Create a header ## Test
  2. Create a link [](#Test)
  3. Perform action on the link
  4. New window of a browser is opened

Expected result

Focus to be placed on the header ## Test

Illustration

_00001-7.mp4

Notes

  • The internal links of this kind are generated by [[toc]] markdown plugin
  • Opening such links via Rich Text editor or markdown preview produces the expected result outlined above (focus to be placed correctly)
  • Originally discovered here:
    https://discourse.joplinapp.org/t/toc-available-in-markdown/23411/2
  • Header links from Outline plugin ([note-title#header](:/fe92c4868e0045b9a36577b4563497b3#header)) also cannot focus on the header using Perform action feature (link following is successful though, no browser is opened). On the other hand, focusing on header is possible via markdown preview and rich text editor.
  • I'm not sure if it's actually in the scope of the project as the application is pretty niche but I still thought to give you a hint

Sample note used in illustration

Perform action internal link test.md

Logs

The moment when the perform action is triggered on the link, no errors 🤷‍♂️

14:42:54: CommandService::execute: editor.richMarkdown.clickAtCursor
Logger.ts:217 14:42:54: PluginRunner: Got message (3): joplin.commands.execute editor.execCommand {name: 'clickUnderCursor'}args: []name: "clickUnderCursor"[[Prototype]]: Object
Logger.ts:217 14:42:54: CommandService::execute: editor.execCommand {name: 'clickUnderCursor'}args: []name: "clickUnderCursor"[[Prototype]]: Object
Logger.ts:217 14:42:54: CodeMirror: execCommand {name: 'editor.execCommand', value: {…}}

Environment

Rich Markdown v0.8.3
Joplin 2.6.10 (prod, linux)
Kubuntu 21.04

@CalebJohn
Copy link
Owner

Thanks for the report @graphit0. Header links (like from the outline plugin [note-title#header](:/fe92c4868e0045b9a36577b4563497b3#header)) have been on my list for awhile now, and are will be working in the next release (just waiting on Joplin v2.7).

Normal header links however have been an oversight, it looks like they won't be as easy to get working, but I'll start looking in to it.

@executed
Copy link

executed commented Dec 2, 2024

@CalebJohn
links like note-title#header) work with "Perform Action" shortcut only when the referred note is different from the active note.
When such link referees to different header of active notes it does not work.

I think it will need to be fixed in Joplin core, rather than in the Rich Markdown plugin.
The reason is that even clicking on such a link on the view-only side of the editor does not change the focus.

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

No branches or pull requests

3 participants