We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b3d4658 commit af9bda3Copy full SHA for af9bda3
src/utils/TreeBuilder.ts
@@ -172,9 +172,10 @@ export class TreeBuilder {
172
}
173
174
// if it's not a FOLDER, then it's FILE or VIRTUAL
175
- const extension = path.split('.').pop() ?? '';
176
- let result = path.replace(RegExp('(\/|^)[^\.\/]+.' + extension + '$'), '');
177
- result = result === '' ? '/' : result.replace(RegExp('\.[^\.]+\.' + extension + '$'), '.' + extension);
+ // remove the file name if not dots
+ let result = path.replace(/(\/|^)[^./]+\.[^\.]+$/, '');
+ // otherwise, remove the last part of the dendron path
178
+ result = result === '' ? '/' : result.replace(/\.[^\.]+(\.[^\.]+)$/, '$1');
179
return result;
180
181
0 commit comments