fix: Merkliste-Löschen ging nicht — onclick-Attribut HTML-broken

JSON.stringify(a.drucksache) lieferte einen JSON-String mit Doublequotes
(z.B. "18/18089"). Eingesetzt in onclick="merkliste_remove("18/18089")"
brach das das HTML-Attribut beim ersten inneren Doublequote, der Browser
warf 'Unexpected end of input' beim Click und der DELETE-Request kam nie
beim Server an.

Fix: escHtml() um den JSON-String, sodass Quotes als " gerendert
werden — onclick-Attribut bleibt valide.

Bug headless mit Playwright + DEBUG_AUTH_TOKEN gefunden (commit f8cfa42).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Dotty Dotter 2026-05-06 22:39:16 +02:00
parent cb6971ff86
commit c599e5f6b5

View File

@ -251,7 +251,9 @@ function renderRow(a) {
+ '</a>'
+ notiz
+ '</div>'
+ '<button onclick="merkliste_remove(' + JSON.stringify(a.drucksache) + ')"'
// onclick mit doppelt-encoded Quote: JSON.stringify liefert "18/18089"
// mit Doublequotes — die brechen das onclick-Attribut. escHtml(") -> &quot;.
+ '<button onclick="merkliste_remove(' + escHtml(JSON.stringify(a.drucksache)) + ')"'
+ ' title="Aus Merkliste entfernen"'
+ ' style="padding:4px 8px;border:1px solid var(--hairline);border-radius:4px;background:none;'
+ 'cursor:pointer;font-family:var(--font-mono);font-size:11px;color:var(--ecg-dark);'