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