stream-chat-angular 5.11.1 → 5.11.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -20,7 +20,7 @@ import transliterate from '@stream-io/transliterate';
20
20
  import * as i8 from 'angular-mentions';
21
21
  import { MentionModule } from 'angular-mentions';
22
22
 
23
- const version = '5.11.1';
23
+ const version = '5.11.2';
24
24
 
25
25
  /**
26
26
  * The `NotificationService` can be used to add or remove notifications. By default the [`NotificationList`](/chat/docs/sdk/angular/components/NotificationListComponent/) component displays the currently active notifications.
@@ -5191,7 +5191,7 @@ class MessageComponent {
5191
5191
  this.hasTouchSupport = 'ontouchstart' in window || navigator.maxTouchPoints > 0;
5192
5192
  this.subscriptions = [];
5193
5193
  this.isViewInited = false;
5194
- this.urlRegexp = /(?:(?:https?|ftp|file):\/\/|www\.|ftp\.)(?:\([-A-Z0-9+&@#/%=~_|$?!:,.]*\)|[-A-Z0-9+&@#/%=~_|$?!:,.])*(?:\([-A-Z0-9+&@#/%=~_|$?!:,.]*\)|[A-Z0-9+&@#/%=~_|$])/gim;
5194
+ this.urlRegexp = /(?:(?:https?|ftp|file):\/\/|www\.|ftp\.|(?:[a-zA-Z0-9-]+\.)+[a-zA-Z]{2,})(?![^\s]*@[^\s]*)(?:[^\s()<>]+|\([\w\d]+\))*(?<!@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,})/gim;
5195
5195
  this.emojiRegexp = new RegExp(emojiRegex(), 'g');
5196
5196
  this.shouldPreventMessageMenuClose = false;
5197
5197
  this._visibleMessageActionsCount = 0;
@@ -5561,9 +5561,20 @@ class MessageComponent {
5561
5561
  if (this.displayAs === 'html') {
5562
5562
  return content;
5563
5563
  }
5564
- content = content.replace(this.urlRegexp, (match) => this.messageService.customLinkRenderer
5565
- ? this.messageService.customLinkRenderer(match)
5566
- : `<a href="${match}" target="_blank" rel="nofollow">${match}</a>`);
5564
+ content = content.replace(this.urlRegexp, (match) => {
5565
+ if (this.messageService.customLinkRenderer) {
5566
+ return this.messageService.customLinkRenderer(match);
5567
+ }
5568
+ else {
5569
+ let href = match;
5570
+ if (!href.startsWith('http') &&
5571
+ !href.startsWith('ftp') &&
5572
+ !href.startsWith('file')) {
5573
+ href = `https://${match}`;
5574
+ }
5575
+ return `<a href="${href}" target="_blank" rel="nofollow">${match}</a>`;
5576
+ }
5577
+ });
5567
5578
  return content;
5568
5579
  }
5569
5580
  updateReadByText() {