diff --git a/www/js/channel/chatPostprocessor.js b/www/js/channel/chatPostprocessor.js index 818c533..4b8759d 100644 --- a/www/js/channel/chatPostprocessor.js +++ b/www/js/channel/chatPostprocessor.js @@ -116,6 +116,7 @@ class chatPostprocessor{ const link = document.createElement('a'); link.classList.add('chat-link', ...wordObj.filterClasses); link.href = wordObj.link; + link.target = "_blank"; //Use textContent to be safe since links can't be escaped serverside link.textContent = wordObj.link; @@ -126,6 +127,7 @@ class chatPostprocessor{ const badLink = document.createElement('a'); badLink.classList.add('chat-dead-link', 'danger-link', ...wordObj.filterClasses); badLink.href = wordObj.link; + badLink.target = "_blank"; //Use textContent to be safe since links can't be escaped serverside badLink.textContent = wordObj.link; @@ -213,6 +215,7 @@ class chatPostprocessor{ link.classList.add('chat-link', ...wordObj.filterClasses); //Set href and inner text link.href = `/c/${wordObj.chan}`; + link.target = "_blank" link.textContent = wordObj.string; //We don't have to worry about injecting this into whitespace since there shouldn't be any here.