if (event.defaultPrevented) return

                // ensure target is a link
                let el = event.target
                while (el && el.nodeName !== 'A') el = el.parentNode
                if (!el || el.nodeName !== 'A') return

                if (
                  el.hasAttribute('download') ||
                  el.getAttribute('rel') === 'external' ||
                  el.target ||
                  el.href.startsWith('javascript:')
                )
                  return

              