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

All: Fixes #853: Replace characters to equivalent US-ASCII ones when exporting files

This commit is contained in:
Laurent Cozic
2018-10-05 17:53:55 +01:00
parent 57fd1a7588
commit b880be8b7c
5 changed files with 14 additions and 1 deletions

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 unidecode = require('unidecode');
class InteropService_Exporter_Md extends InteropService_Exporter_Base {
@@ -40,7 +41,7 @@ class InteropService_Exporter_Md extends InteropService_Exporter_Base {
}
if (item.type_ === BaseModel.TYPE_NOTE) {
const noteFilePath = dirPath + '/' + safeFilename(item.title, null, true) + '.md';
const noteFilePath = dirPath + '/' + safeFilename(unidecode(item.title), null, true) + '.md';
const noteContent = await Note.serializeForEdit(item);
await shim.fsDriver().writeFile(noteFilePath, noteContent, 'utf-8');
}