From dd7a9a356ba3f289e304ec3d1981c4298cebb9c8 Mon Sep 17 00:00:00 2001 From: VM8gkAs <61822684+VM8gkAs@users.noreply.github.com> Date: Fri, 27 Sep 2024 11:38:41 +0800 Subject: [PATCH] Fix unit icon paths and Chinese filenames not auto-completing URLs. (#1940) --- .../project-info-authoring/project-info-authoring.component.ts | 2 +- src/assets/wise5/services/projectService.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/assets/wise5/authoringTool/project-info-authoring/project-info-authoring.component.ts b/src/assets/wise5/authoringTool/project-info-authoring/project-info-authoring.component.ts index 42736645c5d..d29b08bbe99 100644 --- a/src/assets/wise5/authoringTool/project-info-authoring/project-info-authoring.component.ts +++ b/src/assets/wise5/authoringTool/project-info-authoring/project-info-authoring.component.ts @@ -129,7 +129,7 @@ export class ProjectInfoAuthoringComponent { protected setFeaturedProjectIcon(projectIcon: string): void { this.projectService.setFeaturedProjectIcon(projectIcon).then(() => { - this.projectIcon = `projectIcons/${projectIcon}`; + this.projectIcon = `/projectIcons/${projectIcon}`; this.showProjectIcon(); this.closeEditProjectIconMode(); }); diff --git a/src/assets/wise5/services/projectService.ts b/src/assets/wise5/services/projectService.ts index 29ad585e14e..0fdf55ce8a9 100644 --- a/src/assets/wise5/services/projectService.ts +++ b/src/assets/wise5/services/projectService.ts @@ -443,7 +443,7 @@ export class ProjectService { // note that this also works for \"abc.png and \'abc.png, where the quotes are escaped contentString = contentString.replace( new RegExp( - "('|\"|\\\\'|\\\\\")[^:][^/]?[^/]?[a-zA-Z0-9@%&;\\._\\/\\s\\-']*[.]" + + "('|\"|\\\\'|\\\\\")[^:][^/]?[^/]?[a-zA-Z0-9\u4e00-\u9fa5@%&;\\._\\/\\s\\-']*[.]" + '(png|jpe?g|pdf|gif|mov|mp4|mp3|wav|swf|css|txt|json|xlsx?|doc|html.*?|js).*?' + '(\'|"|\\\\\'|\\\\")', 'gi'