Skip to content

Fixes to ctrl+click and middle-click behaviour of links in virtual content#54

Open
aaandreeew wants to merge 2 commits intoSignynt:mainfrom
aaandreeew:main
Open

Fixes to ctrl+click and middle-click behaviour of links in virtual content#54
aaandreeew wants to merge 2 commits intoSignynt:mainfrom
aaandreeew:main

Conversation

@aaandreeew
Copy link
Copy Markdown

This PR addresses #53.

Two changes:

  • Prevent links from being opened twice in two new tabs when they are middle-clicked or ctrl+clicked from reading view.
  • Copy an existing fix for ctrl-click of external file links to also work when middle-clicking. This makes external file links consistent with Obsidian's default behaviour in both live preview and reading view.

I have not tested this PR, as I don't know how the build pipeline works. I have only tested by modifying files of the already installed plugin, which are processed JS files and not the source TS files.

Fixes issue where ctrl+click or middle-click on a link while in reading view would cause the link to be opened twice in two new tabs.
Makes middle-click on external file links in both live preview and soure mode consistent between virtual content and default obsidian behaviour.

This is a simple copy of the same code which only applied to ctrl+click on external file links.
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.

1 participant