1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-26 19:47:20 +00:00

Fix: on Windows, tiddlywiki.files title source shoud use / instead of \ (#7949)

* fix: on Windows, tiddlywiki.files title source shoud use / instead of \

* fix: split path.sep instead of /
This commit is contained in:
lin onetwo 2024-02-06 01:00:09 +08:00 committed by GitHub
parent 94e0f05af5
commit 2b1efac6ee
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1967,10 +1967,10 @@ $tw.loadTiddlersFromSpecification = function(filepath,excludeRegExp) {
var value = tiddler[name];
switch(fieldInfo.source) {
case "subdirectories":
value = path.relative(rootPath, filename).split('/').slice(0, -1);
value = path.relative(rootPath, filename).split(path.sep).slice(0, -1);
break;
case "filepath":
value = path.relative(rootPath, filename);
value = path.relative(rootPath, filename).split(path.sep).join('/');
break;
case "filename":
value = path.basename(filename);