You've already forked joplin
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:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user