mdedit's loadServerDirectory derived its file-tree root by stripping back to the last "/" in window.location.href. For a no-trailing-slash canonical URL (<project>/working) that gave the wrong root: the parent project directory rather than working/ itself. Visible symptom on zddc-server's auto-served URLs after the recent dispatcher changes — mdedit at /Project/working would show the project's archive, working, staging, etc. all together instead of being sandboxed to working/. Detect the directory-shaped URL by checking whether the last path segment contains "." (file marker). No dot = directory; treat the whole path as the root and append the trailing slash internally. /Project/working → root /Project/working/ (was /Project/) /Project/working/x/y/ → root /Project/working/x/y/ (unchanged) /Project/x/mdedit.html → root /Project/x/ (file URL; unchanged) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| app.js | ||
| editor.js | ||
| events.js | ||
| file-ops.js | ||
| file-system.js | ||
| file-tree.js | ||
| front-matter.js | ||
| main.js | ||
| resizer.js | ||
| toc.js | ||
| utils.js | ||