We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2fa2484 commit cb95e18Copy full SHA for cb95e18
next/api/src/integration/slack/message.ts
@@ -41,11 +41,21 @@ export class Message {
41
}
42
43
44
-function getTicketLink(ticket: Ticket): string {
+function escapeSlackCharacters(text:string) {
45
+ return text
46
+ .replace(/&/g, '&')
47
+ .replace(/</g, '<')
48
+ .replace(/>/g, '>');
49
+}
50
+
51
+function getTicketLink(ticket:Ticket) {
52
let title = ticket.title;
53
if (title.length > 50) {
54
title = title.slice(0, 47) + '...';
55
56
+ // Escape special characters in the title
57
+ title = escapeSlackCharacters(title);
58
59
return `<${ticket.getUrl()}|*#${ticket.nid}: ${title}*>`;
60
61
0 commit comments