mirror of
https://github.com/cheeaun/phanpy.git
synced 2025-02-02 14:16:39 +01:00
Ignore cmd/ctrl/shift/alt keys + middle clicks
This commit is contained in:
parent
674c99a05d
commit
7e01b4a33a
1 changed files with 6 additions and 0 deletions
|
@ -6,6 +6,12 @@ function handleContentLinks(opts) {
|
|||
let { target } = e;
|
||||
target = target.closest('a');
|
||||
if (!target) return;
|
||||
|
||||
// If cmd/ctrl/shift/alt key is pressed or middle-click, let the browser handle it
|
||||
if (e.metaKey || e.ctrlKey || e.shiftKey || e.altKey || e.which === 2) {
|
||||
return;
|
||||
}
|
||||
|
||||
const prevText = target.previousSibling?.textContent;
|
||||
const textBeforeLinkIsAt = prevText?.endsWith('@');
|
||||
const textStartsWithAt = target.innerText.startsWith('@');
|
||||
|
|
Loading…
Reference in a new issue