1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-24 10:27:10 +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

@ -2890,6 +2890,11 @@
"resolved": "https://registry.npmjs.org/unc-path-regex/-/unc-path-regex-0.1.2.tgz",
"integrity": "sha1-5z3T17DXxe2G+6xrCufYxqadUPo="
},
"unidecode": {
"version": "0.1.8",
"resolved": "https://registry.npmjs.org/unidecode/-/unidecode-0.1.8.tgz",
"integrity": "sha1-77swFTi8RSRqmsjFWdcvAVMFBT4="
},
"uniq": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/uniq/-/uniq-1.0.1.tgz",

View File

@ -68,6 +68,7 @@
"tar": "^4.4.0",
"tcp-port-used": "^0.1.2",
"tkwidgets": "^0.5.26",
"unidecode": "^0.1.8",
"url-parse": "^1.2.0",
"uuid": "^3.0.1",
"valid-url": "^1.0.9",

View File

@ -6981,6 +6981,11 @@
"random-bytes": "~1.0.0"
}
},
"unidecode": {
"version": "0.1.8",
"resolved": "https://registry.npmjs.org/unidecode/-/unidecode-0.1.8.tgz",
"integrity": "sha1-77swFTi8RSRqmsjFWdcvAVMFBT4="
},
"union-value": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.0.tgz",

View File

@ -127,6 +127,7 @@
"syswide-cas": "^5.1.0",
"tar": "^4.4.4",
"tcp-port-used": "^0.1.2",
"unidecode": "^0.1.8",
"url-parse": "^1.4.1",
"uuid": "^3.2.1",
"valid-url": "^1.0.9",

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');
}