1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-06-15 23:00:36 +02:00

Desktop: Fixes #1425 (probably): Fix display of images when using VSCode as external editor

This commit is contained in:
Laurent Cozic
2019-04-20 21:12:19 +01:00
parent 4ef05272c4
commit 220f5d0967
2 changed files with 9 additions and 4 deletions

View File

@ -100,6 +100,11 @@ function friendlySafeFilename(e, maxLength = null) {
return output.substr(0, maxLength);
}
function toFileProtocolPath(path) {
const output = path.replace(/\\/g, "/");
return 'file://' + escape(output);
}
function toSystemSlashes(path, os = null) {
if (os === null) os = process.platform;
if (os === 'win32') return path.replace(/\//g, "\\");
@ -153,4 +158,4 @@ function extractExecutablePath(cmd) {
return output;
}
module.exports = { extractExecutablePath, basename, dirname, filename, isHidden, fileExtension, safeFilename, friendlySafeFilename, safeFileExtension, toSystemSlashes, rtrimSlashes, ltrimSlashes, quotePath, unquotePath };
module.exports = { toFileProtocolPath, extractExecutablePath, basename, dirname, filename, isHidden, fileExtension, safeFilename, friendlySafeFilename, safeFileExtension, toSystemSlashes, rtrimSlashes, ltrimSlashes, quotePath, unquotePath };