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

All: Resolves #734: Allow exporting to a hierarchy of Markdown files, and fixed a few issues related to exporting notebooks

This commit is contained in:
Laurent Cozic
2018-09-04 11:59:09 +01:00
parent 81ec8eaf83
commit eaf3eef2d3
5 changed files with 80 additions and 8 deletions

View File

@ -40,9 +40,11 @@ function safeFileExtension(e) {
return e.replace(/[^a-zA-Z0-9]/g, '')
}
function safeFilename(e, maxLength = 32) {
function safeFilename(e, maxLength = null, allowSpaces = false) {
if (maxLength === null) maxLength = 32;
if (!e || !e.replace) return '';
let output = e.replace(/[^a-zA-Z0-9\-_\(\)\.]/g, '_')
const regex = allowSpaces ? /[^a-zA-Z0-9\-_\(\)\. ]/g : /[^a-zA-Z0-9\-_\(\)\.]/g
let output = e.replace(regex, '_')
return output.substr(0, maxLength);
}