diff --git a/src/bootstrap.js b/src/bootstrap.js index 5f73a09dc7e65ea1873da110fe124039e47eb671..ab57c6dc83cc3683638c13ac881182088916971a 100644 --- a/src/bootstrap.js +++ b/src/bootstrap.js @@ -69,7 +69,15 @@ exports.uriFromPath = function (_path) { pathName = '/' + pathName; } - return encodeURI('file://' + pathName).replace(/#/g, '%23'); + /** @type {string} */ + let uri; + if (pathName.startsWith('//')) { + uri = encodeURI('file:' + pathName); + } else { + uri = encodeURI('file://' + pathName); + } + + return uri.replace(/#/g, '%23'); }; //#endregion