joplin-rich-markdown icon indicating copy to clipboard operation
joplin-rich-markdown copied to clipboard

Perform Action on internal links [](#header)

Open graphit0 opened this issue 2 years ago • 1 comments

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

https://user-images.githubusercontent.com/44114323/151963700-4c108b3f-b9ff-4c46-ad59-a5f8db23386a.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 :man_shrugging:

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

graphit0 avatar Feb 01 '22 11:02 graphit0

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.

CalebJohn avatar Feb 02 '22 01:02 CalebJohn