From fb4ca46e8ff5276860c5070949ff58ba46efb85b Mon Sep 17 00:00:00 2001 From: Ivan Fonseca Date: Tue, 24 Jul 2018 16:06:44 -0400 Subject: [PATCH] Don't count tildes.net links as external --- tildes/static/js/behaviors/external-links-new-tabs.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tildes/static/js/behaviors/external-links-new-tabs.js b/tildes/static/js/behaviors/external-links-new-tabs.js index ff46571..9afb2ff 100644 --- a/tildes/static/js/behaviors/external-links-new-tabs.js +++ b/tildes/static/js/behaviors/external-links-new-tabs.js @@ -1,4 +1,7 @@ $.onmount('[data-js-external-links-new-tabs]', function() { // Make all links in comment open in new tab - $(this).find('a[href^="http"]').attr('target', '_blank'); + $(this).find( + 'a[href^="http"]' + // Select external links + ':not([href*="tildes.net"])' // But not links to tildes + ).attr('target', '_blank'); });