Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/lib/utils/url-link-converter.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,10 @@ export function convertUrlsToLinks(text) {
const beforeUrl = textWithPlaceholders.slice(lastIndex, match.index);
result += escapeHtml(beforeUrl);

// Add the URL as a clickable link
// Add the URL as a clickable link (escape in both href and display text)
const url = match[0];
result += `<a href="${url}" target="_blank" rel="noopener noreferrer">${url}</a>`;
const escapedUrl = escapeHtml(url);
result += `<a href="${escapedUrl}" target="_blank" rel="noopener noreferrer">${escapedUrl}</a>`;

lastIndex = httpsUrlRegex.lastIndex;
}
Expand Down
Loading