Skip to content

Commit

Permalink
link should be finally clickable
Browse files Browse the repository at this point in the history
  • Loading branch information
Fiszh authored Oct 3, 2024
1 parent b822060 commit e6315dd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,11 @@ function getRandomTwitchColor() {

async function makeLinksClickable(message) {
if (!message) return '';
return message
const urlRegex = /\b([a-zA-Z0-9-]+\.[a-zA-Z]{2,})(\/\S*)?\b/g;

return message.replace(urlRegex, function(url) {
return `<a href="https://${url}" target="_blank" style="color: white;">${url}</a>`;
});
}

async function updateAllEmoteData() {
Expand Down

0 comments on commit e6315dd

Please sign in to comment.