fix links
This commit is contained in:
parent
04db451cd9
commit
a90cc514f0
@ -4,7 +4,7 @@ import { Pipe, PipeTransform } from '@angular/core';
|
|||||||
export class UrlTextPipe implements PipeTransform {
|
export class UrlTextPipe implements PipeTransform {
|
||||||
|
|
||||||
httpPattern = /(\b(https?:\/\/)([-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|]))/ig;
|
httpPattern = /(\b(https?:\/\/)([-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|]))/ig;
|
||||||
wwwPattern =/(^|[^\/])(www\.[\S]+(\b|$))/gim;
|
wwwPattern =/(^|[^\/>])(www\.[\S]+(\b|$))/gim;
|
||||||
|
|
||||||
transform(value: string): any {
|
transform(value: string): any {
|
||||||
value = value.replace(this.httpPattern, '<a href="$1" target="_blank">$3</a>');
|
value = value.replace(this.httpPattern, '<a href="$1" target="_blank">$3</a>');
|
||||||
|
Loading…
Reference in New Issue
Block a user