1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-11-06 09:19:22 +02:00

Desktop, Cli: Fixes #3760: Improved handling of special characters when exporting to Markdown

This commit is contained in:
Laurent Cozic
2020-09-22 12:06:19 +01:00
parent 56c6cfc785
commit b3f2bbee5b
2 changed files with 3 additions and 2 deletions

View File

@@ -58,7 +58,7 @@ function safeFilename(e, maxLength = null, allowSpaces = false) {
return output.substr(0, maxLength);
}
let friendlySafeFilename_blackListChars = '/<>:\'"\\|?*';
let friendlySafeFilename_blackListChars = '/<>:\'"\\|?*#';
for (let i = 0; i < 32; i++) {
friendlySafeFilename_blackListChars += String.fromCharCode(i);
}

View File

@@ -4,6 +4,7 @@ const BaseModel = require('lib/BaseModel');
const Folder = require('lib/models/Folder');
const Note = require('lib/models/Note');
const { shim } = require('lib/shim');
const markdownUtils = require('lib/markdownUtils');
class InteropService_Exporter_Md extends InteropService_Exporter_Base {
async init(destDir) {
@@ -53,7 +54,7 @@ class InteropService_Exporter_Md extends InteropService_Exporter_Base {
const notePaths = this.context() && this.context().notePaths ? this.context().notePaths : {};
const createRelativePath = function(notePath) {
return encodeURI(`${relativePathToRoot}${notePath}`.trim());
return markdownUtils.escapeLinkUrl(`${relativePathToRoot}${notePath}`.trim());
};
return await this.replaceItemIdsByRelativePaths_(noteBody, linkedNoteIds, notePaths, createRelativePath);
}