From a8ec71cd1cf85b971e538e9730fefcfb5da15dc9 Mon Sep 17 00:00:00 2001 From: Vitaly Yakovenko Date: Thu, 13 May 2021 12:40:35 +0300 Subject: [PATCH] fix: support query string in links --- .../ngx-editor/src/lib/modules/menu/image/image.component.ts | 2 +- projects/ngx-editor/src/lib/modules/menu/link/link.component.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/projects/ngx-editor/src/lib/modules/menu/image/image.component.ts b/projects/ngx-editor/src/lib/modules/menu/image/image.component.ts index e772ef52..bb7f657d 100644 --- a/projects/ngx-editor/src/lib/modules/menu/image/image.component.ts +++ b/projects/ngx-editor/src/lib/modules/menu/image/image.component.ts @@ -25,7 +25,7 @@ export class ImageComponent implements OnInit, OnDestroy { form = new FormGroup({ src: new FormControl('', [ Validators.required, - Validators.pattern('(https?://)?([\\da-z.-]+)\\.([a-z.]{2,6})[/\\w .-]*/?') + Validators.pattern('(https?://)?([\\da-z.-]+)\\.([a-z.]{2,6})[/\\w .-]*/??([^#\n\r]*)?#?([^\n\r]*)') ]), alt: new FormControl(''), title: new FormControl('') diff --git a/projects/ngx-editor/src/lib/modules/menu/link/link.component.ts b/projects/ngx-editor/src/lib/modules/menu/link/link.component.ts index c5bc6aef..720862c8 100644 --- a/projects/ngx-editor/src/lib/modules/menu/link/link.component.ts +++ b/projects/ngx-editor/src/lib/modules/menu/link/link.component.ts @@ -27,7 +27,7 @@ export class LinkComponent implements OnInit, OnDestroy { form = new FormGroup({ href: new FormControl('', [ Validators.required, - Validators.pattern('(https?://)?([\\da-z.-]+)\\.([a-z.]{2,6})[/\\w .-]*/?') + Validators.pattern('(https?://)?([\\da-z.-]+)\\.([a-z.]{2,6})[/\\w .-]*/??([^#\n\r]*)?#?([^\n\r]*)') ]), text: new FormControl('', [Validators.required]), openInNewTab: new FormControl(true)