From 1450a556836b759c6d5ee18efb3ca12c9d258ce7 Mon Sep 17 00:00:00 2001 From: Gamosoft Date: Fri, 19 Dec 2025 17:39:38 +0100 Subject: [PATCH] fixed path for images with unicode --- frontend/app.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/frontend/app.js b/frontend/app.js index 259d3d4..08c2e39 100644 --- a/frontend/app.js +++ b/frontend/app.js @@ -3801,7 +3801,14 @@ function noteApp() { !src.startsWith('//') && !src.startsWith('/api/images/') && !src.startsWith('data:')) { // URL-encode path segments to handle spaces and special characters - const encodedPath = src.split('/').map(segment => encodeURIComponent(segment)).join('/'); + // Decode first to avoid double-encoding if path already contains %XX sequences + const encodedPath = src.split('/').map(segment => { + try { + return encodeURIComponent(decodeURIComponent(segment)); + } catch (e) { + return encodeURIComponent(segment); + } + }).join('/'); img.setAttribute('src', `/api/images/${encodedPath}`); } }