diff --git a/package-lock.json b/package-lock.json index 3d261275b..173356785 100644 --- a/package-lock.json +++ b/package-lock.json @@ -58,6 +58,7 @@ "markdown-it-container": "^3.0.0", "markdown-it-task-lists": "^2.1.1", "mitt": "^3.0.0", + "path-normalize": "^6.0.2", "prosemirror-collab": "^1.2.2", "prosemirror-inputrules": "^1.2.0", "prosemirror-markdown": "^1.8.0", @@ -15160,6 +15161,18 @@ "node": ">=8" } }, + "node_modules/path-normalize": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/path-normalize/-/path-normalize-6.0.5.tgz", + "integrity": "sha512-Q4llJDh05rai/L6hUImUcJN3uStwnYQX1fQ0+c2mX8287pl23sWalkhiw/BDOl8CrWE+Q2Ce6v4p4ty1gytdtA==", + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "type": "ko-fi", + "url": "https://ko-fi.com/zacanger" + } + }, "node_modules/path-parse": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", @@ -31149,6 +31162,11 @@ "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", "dev": true }, + "path-normalize": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/path-normalize/-/path-normalize-6.0.5.tgz", + "integrity": "sha512-Q4llJDh05rai/L6hUImUcJN3uStwnYQX1fQ0+c2mX8287pl23sWalkhiw/BDOl8CrWE+Q2Ce6v4p4ty1gytdtA==" + }, "path-parse": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", diff --git a/package.json b/package.json index a505a8464..aefb2301f 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,9 @@ } ], "license": "agpl", - "files": ["dist"], + "files": [ + "dist" + ], "module": "dist/index.js", "main": "dist/index.js", "scripts": { @@ -80,6 +82,7 @@ "markdown-it-container": "^3.0.0", "markdown-it-task-lists": "^2.1.1", "mitt": "^3.0.0", + "path-normalize": "^6.0.2", "prosemirror-collab": "^1.2.2", "prosemirror-inputrules": "^1.2.0", "prosemirror-markdown": "^1.8.0", diff --git a/src/services/ImageResolver.js b/src/services/ImageResolver.js index d3bf300fc..be6469e96 100644 --- a/src/services/ImageResolver.js +++ b/src/services/ImageResolver.js @@ -21,7 +21,7 @@ */ import { generateUrl, generateRemoteUrl } from '@nextcloud/router' -import path from 'path' +import pathNormalize from 'path-normalize' export default class ImageResolver { @@ -158,7 +158,7 @@ export default class ImageResolver { this.#currentDirectory, this.#relativePath(src), ].join('/') - return path.normalize(f) + return pathNormalize(f) } }