joplin
joplin copied to clipboard
During Markdown export, folders that differ only by one special character are lost
Operating system
Windows
Joplin version
2.13.6
Desktop version info
Joplin 2.13.6 (dev, win32)
Client ID: 7ff86a7f457d478e9dd5868ba2227a09 Sync Version: 3 Profile Version: 44 Keychain Supported: Yes
Revision: e7dd981
Current behaviour
- Create a notebook
Test>1
with some random note - Create a notebook
Test<1
with some random note - Create a notebook
Test?1
with some random note in the notebookTest>1
- Select
File
>Export all
>MD Markdown
orMD Markdown + Front Matter
- Select destination folder
All notes are exported to the same folder Test_1
and the other folder is lost thereby also the structure of the notes.
Content of the First Test_1
folder:
Expected behaviour
All folders should be preserved, possibly with the addition of a number like the frist folder would be Test_1
and the next one Test_1_1
Logs
No response
I tried to create a cleaver solution by keeping track of what file were being created, associating it with item.id to avoid using a folder that didn't belong to that id but my solution wasn't working, and to be honest I was still a little lost on what was happening.
So I thought about an alternative, which would be to change the unsafe chars to something else other than underscore:
https://github.com/laurent22/joplin/blob/07ee20a0ff13fff779617beb39a79d5ba19fbc3c/packages/lib/path-utils.ts#L38-L45
for (let i = 0; i < e.length; i++) {
const c = e[i];
if (friendlySafeFilename_blackListChars.indexOf(c) >= 0) {
output += `%${c.charCodeAt(0)}`;
} else {
output += c;
}
}
The problem is that we lose the "friendly name" factor from the friendlySafeFilename
function:
Maybe we can find middle ground?
Looking at how Obsidian handles special characters, I made this test on Linux. I want to test on Windows too.
- They don't allow
\ / :
in folder name - If you try to use them anyway, the characters are removed from the folder name ("Folder \ name" will turn to "Folder name")
- If there is already a folder with the same name it gets renamed to "Untitled", "Untitled 1", "Untitlted 2", etc
- Besides these characters, there are others that limit usage but are allowed, see image:
On Windows, the not-allowed character list is different, would be interesting to see how they sync both folders from different OS.