fix: Fix agent name in Twitter channel private note acting as a link (#4326)
This commit is contained in:
parent
eff3a50316
commit
3cd1616df6
4 changed files with 42 additions and 7 deletions
|
@ -13,8 +13,9 @@ const TWITTER_HASH_REPLACEMENT =
|
|||
const USER_MENTIONS_REGEX = /mention:\/\/(user|team)\/(\d+)\/(.+)/gm;
|
||||
|
||||
class MessageFormatter {
|
||||
constructor(message, isATweet = false) {
|
||||
constructor(message, isATweet = false, isAPrivateNote = false) {
|
||||
this.message = DOMPurify.sanitize(escapeHtml(message || ''));
|
||||
this.isAPrivateNote = isAPrivateNote;
|
||||
this.isATweet = isATweet;
|
||||
this.marked = marked;
|
||||
|
||||
|
@ -35,7 +36,7 @@ class MessageFormatter {
|
|||
}
|
||||
|
||||
formatMessage() {
|
||||
if (this.isATweet) {
|
||||
if (this.isATweet && !this.isAPrivateNote) {
|
||||
const withUserName = this.message.replace(
|
||||
TWITTER_USERNAME_REGEX,
|
||||
TWITTER_USERNAME_REPLACEMENT
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue