diff options
author | Azul <azul@riseup.net> | 2020-06-18 08:59:49 +0300 |
---|---|---|
committer | Azul <azul@riseup.net> | 2020-08-11 16:42:35 +0300 |
commit | 56701f9e7b9c93e1d4b1ab10b041f132e21701b1 (patch) | |
tree | 45ee885a83bd374e6c7f0721f7a16829a23598f9 /src | |
parent | 8640eaa2ff4264355930d83679fb21939095f32d (diff) |
open relative links in new tab on middle click
also take into account `ctrl` keys.
Use the href from html rather than markdown.
This is an actual link that will work in nextcloud.
Signed-off-by: Azul <azul@riseup.net>
Diffstat (limited to 'src')
-rw-r--r-- | src/marks/index.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/marks/index.js b/src/marks/index.js index cb8d7b091..b2658d680 100644 --- a/src/marks/index.js +++ b/src/marks/index.js @@ -119,10 +119,10 @@ class Link extends TipTapLink { if (attrs.href && event.target instanceof HTMLAnchorElement) { event.stopPropagation() const htmlHref = event.target.attributes.href.value - if (htmlHref.match(/^\?/)) { + if (event.button === 0 && !event.ctrlKey && htmlHref.match(/^\?/)) { window.location = htmlHref } else { - window.open(attrs.href) + window.open(htmlHref) } } }, |