Con JavaScript possiamo far aprire i link esterni in una nuova finestra.
La soluzione รจ la seguente:
'use strict';
const addTargetBlank = () => {
let links = document.querySelectorAll('a'),
url = location.protocol + '//' + location.host,
reg = /^#|mailto|tel|javascript/;
Array.prototype.forEach.call(links, link => {
let href = link.getAttribute('href');
if(href.length > 0 && !href.includes(url) && !reg.test(href)) {
link.setAttribute('target', '_blank');
}
});
};