From ec16de875da07b3f262119039e72c9af7a839be2 Mon Sep 17 00:00:00 2001 From: adam Date: Tue, 13 Oct 2026 09:27:02 +0100 Subject: [PATCH] Added by Jarl: wrap long statements with a CSS class, not an inline style The page's Content Security Policy (style-src 'self') blocked the inline style attribute, so long statements didn't wrap and the browser console reported the violation. Co-Authored-By: Claude Opus 5.5 --- CHANGELOG.md | 6 ++++++ internal/web/static/assets/pages/options.js | 2 +- internal/web/static/assets/style.css | 3 +++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 11d8a99..d0436a8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -38,6 +38,12 @@ All notable changes to Jarl are documented here. The format follows - Zone commands take a network for a reverse zone: `jarl zone show 10.0.10.0/24`. +### Fixed + +- Server options → Added by Jarl: long statements didn't wrap, and the + browser console reported a Content Security Policy violation (an inline + style the page's policy blocks). + ### Upgrading - The database gets two new versions (12 and 13), applied when jarld diff --git a/internal/web/static/assets/pages/options.js b/internal/web/static/assets/pages/options.js index 5f29e92..b7b444e 100644 --- a/internal/web/static/assets/pages/options.js +++ b/internal/web/static/assets/pages/options.js @@ -182,7 +182,7 @@ function generatedPanel(el, list) { h("thead", null, h("tr", null, h("th", null, "Where"), h("th", null, "Statement"), h("th", null, "Why"), h("th", null, "Controlled by"))), h("tbody", null, list.map((g) => h("tr", null, h("td", { class: "small" }, g.where), - h("td", null, h("pre", { class: "code optval", style: "white-space: pre-wrap; word-break: break-all" }, g.text)), + h("td", null, h("pre", { class: "code optval wrap" }, g.text)), h("td", { class: "small" }, g.why), h("td", { class: "small mono" }, g.setting)))))))); } diff --git a/internal/web/static/assets/style.css b/internal/web/static/assets/style.css index a7f2cc4..71eae9f 100644 --- a/internal/web/static/assets/style.css +++ b/internal/web/static/assets/style.css @@ -567,3 +567,6 @@ ul.probes > li .msg { margin: 6px 0 0; } table.compare td.compare-cell { vertical-align: top; } table.compare td.compare-cell button { margin-top: 4px; } table.compare tr.muted td { color: var(--muted); } + +/* Text that wraps anywhere, e.g. long statements in the Added by Jarl table. */ +pre.wrap { white-space: pre-wrap; word-break: break-all; }