Skip to content

Commit

Permalink
fix: use replace instead of replaceAll
Browse files Browse the repository at this point in the history
  • Loading branch information
christophehurpeau committed Sep 6, 2022
1 parent 713b372 commit fd32789
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/slack/utils.ts
Expand Up @@ -6,9 +6,9 @@ import type { PullRequestWithDecentData } from '../events/pr-handlers/utils/Pull
// https://api.slack.com/reference/surfaces/formatting#escaping
export const escapeText = (text: string): string => {
return text
.replaceAll('&', '&')
.replaceAll('<', '&lt;')
.replaceAll('>', '&gt;');
.replace(/&/g, '&amp;')
.replace(/</g, '&lt;')
.replace(/>/g, '&gt;');
};

export const createLink = (url: string, text: string): string => {
Expand Down

0 comments on commit fd32789

Please sign in to comment.