Skip to content

Commit

Permalink
fix(Tweet): allow uppercased characters in mentions
Browse files Browse the repository at this point in the history
  • Loading branch information
paulleflon committed Sep 15, 2024
1 parent e5f075c commit e48c369
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion public/js/Tweet.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ for (const tw of tweets) {

const contentContainer = tw.querySelector('.tweet-content');
let content = contentContainer.innerText;
content = content.replace(/@([a-z\d_]+)/g, '<a href=\'/profile/$1\'>@$1</a>');
content = content.replace(/@([a-z\d_]+)/gi, '<a href=\'/profile/$1\'>@$1</a>');
const urlRegex = /(https?:\/\/(?:www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b(?:[-a-zA-Z0-9()@:%_\+.~#?&//=]*))/g;
content = content.replace(urlRegex, '<a href=\'$1\' target=\'_blank\'>$1</a>');
contentContainer.innerHTML = content;
Expand Down

0 comments on commit e48c369

Please sign in to comment.