fix: image refs in description and broken gallery URLs

- EditDrawer: stop auto-inserting ![filename](...) into description on
  upload — images are tracked via custom.images; the refs only cluttered
  the textarea. Strip any pre-existing refs on load so old sidecars are
  also cleaned up when the drawer is opened.
- ActivityDetail: imageBase now treats detail_url that starts with '/'
  as already-absolute (same fix pattern as track_url / detail_url);
  was prepending ${base}data/ on top of /data/... → double path.
This commit is contained in:
Davide Scaini
2026-04-16 10:19:32 +02:00
parent 395182649b
commit cfdd8d2744
2 changed files with 5 additions and 9 deletions
+3 -2
View File
@@ -82,10 +82,11 @@
})();
// Derive image dir from detail_url so multi-user paths resolve correctly.
// "dave/_merged/activities/foo.json" → "/data/dave/_merged/activities/images/{id}/"
// Relative: "dave/_merged/activities/foo.json" → "/data/dave/_merged/activities/images/{id}/"
// Absolute: "/data/dave/_merged/activities/foo.json" → "/data/dave/_merged/activities/images/{id}/"
$: imageBase = (() => {
const du = activity.detail_url ?? '';
const dir = du.startsWith('http')
const dir = du.startsWith('http') || du.startsWith('/')
? du.substring(0, du.lastIndexOf('/') + 1)
: du.includes('/')
? `${base}data/${du.substring(0, du.lastIndexOf('/') + 1)}`