diff --git a/src/app/utils/urltext.pipe.ts b/src/app/utils/urltext.pipe.ts index 58e4c75..98fb301 100644 --- a/src/app/utils/urltext.pipe.ts +++ b/src/app/utils/urltext.pipe.ts @@ -17,7 +17,7 @@ export class UrlTextPipe implements PipeTransform { export class UrlBasePipe implements PipeTransform { httpPattern = /(\b(https?:\/\/)([-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|]))/ig; - + transform(value: string): any { if (!value.match(this.httpPattern)) { return ''; @@ -29,6 +29,12 @@ export class UrlBasePipe implements PipeTransform { return ''; } - return parts[2]; + let baseUrl = parts[2]; + + if (baseUrl.startsWith('www.')) { + baseUrl = baseUrl.substr(4); + } + + return baseUrl; } } \ No newline at end of file