replace href with javascript to open links in external browser. issue #4
This commit is contained in:
parent
83cb73cdf4
commit
8d8c9ff9bb
1 changed files with 3 additions and 0 deletions
|
@ -15,6 +15,9 @@ export class ParserPipe implements PipeTransform {
|
|||
constructor(protected _sanitizer: DomSanitizer) {}
|
||||
|
||||
transform(value: string, ...args): SafeHtml | SafeStyle | SafeScript | SafeUrl | SafeResourceUrl {
|
||||
let hregex = /href="([\S]+)"/g;
|
||||
// value = value.replace(hregex, "class=\"ex-link\" href=");
|
||||
value = value.replace(hregex, "onClick=\"window.open('$1', '_system', 'location=yes')\"");
|
||||
return this._sanitizer.bypassSecurityTrustHtml(value);
|
||||
}
|
||||
}
|
||||
|
|
Reference in a new issue