diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/scripts/workspace/scripts-workspace-edit.element.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/scripts/workspace/scripts-workspace-edit.element.ts index d3d4f3d1b7..2d6dccf009 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/templating/scripts/workspace/scripts-workspace-edit.element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/templating/scripts/workspace/scripts-workspace-edit.element.ts @@ -61,7 +61,7 @@ export class UmbScriptsWorkspaceEditElement extends UmbLitElement { this.observe(this.#scriptsWorkspaceContext.path, (path) => { this._path = path; - this._dirName = this._path?.substring(0, this._path?.lastIndexOf('\\') + 1)?.replace('\\', '/'); + this._dirName = this._path?.substring(0, this._path?.lastIndexOf('\\'))?.replace(/\\/g, '/'); }); this.observe(this.#scriptsWorkspaceContext.isNew, (isNew) => { diff --git a/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/workspace/stylesheet-workspace-editor.element.ts b/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/workspace/stylesheet-workspace-editor.element.ts index a485d845a8..d37300a880 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/workspace/stylesheet-workspace-editor.element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/templating/stylesheets/workspace/stylesheet-workspace-editor.element.ts @@ -48,7 +48,7 @@ export class UmbStylesheetWorkspaceEditorElement extends UmbLitElement { this.#workspaceContext.path, (path) => { this._path = path; - this._dirName = this._path?.substring(0, this._path?.lastIndexOf('\\') + 1)?.replace('\\', '/'); + this._dirName = this._path?.substring(0, this._path?.lastIndexOf('\\') + 1)?.replace(/\\/g, '/'); }, '_observeStylesheetPath', );