From 03948038c4d7352f793c6233ce93dabd0fab9c81 Mon Sep 17 00:00:00 2001 From: Dotty Dotter Date: Wed, 6 May 2026 22:40:27 +0200 Subject: [PATCH] =?UTF-8?q?fix:=20Merkliste-L=C3=B6sch-Row=20blieb=20im=20?= =?UTF-8?q?DOM=20=E2=80=94=20ID-Lookup=20vs.=20escAttr=20inkonsistent?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Row-ID wird via escAttr gebildet ([^a-zA-Z0-9_-] → '_'), z.B. '18/18089' landet als id='merkliste-row-18_18089'. Der getElementById-Lookup nutzte aber CSS.escape, das 18/18089 zu 18\\/18089 escaped — zwei verschiedene Strings, getElementById lieferte null, el.remove() lief nicht. Plus: getElementById akzeptiert ohnehin keinen CSS-Selektor — der CSS.escape-Lookup war doppelt falsch. Fix: gleiche Sanitization-Regex wie escAttr im Lookup nutzen. Co-Authored-By: Claude Opus 4.7 (1M context) --- app/templates/v2/screens/merkliste.html | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/templates/v2/screens/merkliste.html b/app/templates/v2/screens/merkliste.html index 1619292..9acb561 100644 --- a/app/templates/v2/screens/merkliste.html +++ b/app/templates/v2/screens/merkliste.html @@ -201,7 +201,10 @@ try { var r = await fetch('/api/me/merkliste/' + encodeURIComponent(antragId), { method: 'DELETE' }); if (r.ok) { - var el = document.getElementById('merkliste-row-' + CSS.escape(antragId)); + // Row-ID wird via escAttr gebildet (alphanumerisch + Unterstrich) — + // gleiche Sanitization für den Lookup, sonst findet getElementById nichts. + var rowId = 'merkliste-row-' + String(antragId || '').replace(/[^a-zA-Z0-9_-]/g, '_'); + var el = document.getElementById(rowId); if (el) el.remove(); if (!resultsEl.querySelectorAll('.merkliste-entry').length) { emptyEl.style.display = '';