Skip to content

Commit

Permalink
fix shortlinks being broken in user info menu
Browse files Browse the repository at this point in the history
  • Loading branch information
zr0w1 committed Dec 10, 2024
1 parent 7c82683 commit 4728e38
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions assets/chat/js/menus/ChatUserInfoMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -359,10 +359,18 @@ export default class ChatUserInfoMenu extends ChatMenuFloating {
nextMsg = nextMsg.next('.msg-continue');
}
this.messageArray.forEach((element) => {
const text = element.find('.text')[0].innerText;
const textContainer = element.find('.text')[0];
let rawText = '';
for (const node of textContainer.childNodes) {
if (node instanceof HTMLAnchorElement) {
rawText += node.href;
} else {
rawText += node.textContent;
}
}

// Create a new `ChatUser` to remove username styles for a cleaner look.
const msg = MessageBuilder.message(text, new ChatUser(nick));
const msg = MessageBuilder.message(rawText, new ChatUser(nick));
displayedMessages.push(msg.html(this.chat));
});
}
Expand Down

0 comments on commit 4728e38

Please sign in to comment.