Why
Two browser errors broke syntax highlighting and violated the CSP:
- HTMX injects a
<style>element for its indicator classes, whichstyle-src 'self'blocks. - Prism installs its own worker message handler that calls
JSON.parse(event.data), butprism-worker.jsposts structured objects. Every highlight job loggedSyntaxError: JSON.parse: unexpected characterbefore the worker’s own handler ran.
What changed
- Added an
htmx-configmeta tag that setsincludeIndicatorStyles: false. - Moved HTMX’s indicator rules into
vole.css, so the stylesheet remains the only style source. - Set
disableWorkerMessageHandler: trueon Prism inprism-worker.js; the worker already owns its message path. - Added regression tests for both fixes.
Verification
vole workflow checkvole workflow run verify(format, vet, build, govulncheck, packaging, links, race tests)go test ./... -count=1