The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Rocket.Chat/app/issuelinks/client/client.js

12 lines
408 B

export const createIssueLinksMessageRenderer = ({ template }) => (message) => {
if (!message.html?.trim()) {
return message;
}
message.html = message.html.replace(/(?:^|\s|\n)(#[0-9]+)\b/g, (match, issueNumber) => {
const url = template.replace('%s', issueNumber.substring(1));
return match.replace(issueNumber, `<a href="${ url }" target="_blank">${ issueNumber }</a>`);
});
return message;
};