Symptom
Fenced code blocks in lessons render monochrome: a ```java
fence shows the language-tagged markup the renderer already emits
(<code class="language-java">, kept through sanitization since
ADR-0013 exactly for this), but no highlighter exists to color it.
Design (summary; full decision in ADR-0017)
Same shape as the Mermaid decision (ADR-0016): the server keeps
shipping sanitized, text-only code blocks; the browser upgrades them.
- highlight.js 11.11.1, self-hosted via the
org.webjars.npm:highlightjs__cdn-assets WebJar (the plain
highlight.js webjar ships no browser bundle since v11), version
pinned, no CDN.
- Lazy:
lesson-highlight.js loads the bundle only when the lesson
contains a language-* block other than language-mermaid.
- Explicit languages only: blocks with unknown hints or bare fences
stay monochrome; no auto-detect guessing.
- Theme-token colors: no vendor CSS; hljs token classes map to the
existing surface-safe accent tokens, so both themes pass WCAG AA by
the contrast-audit proof.
- Sanitizer untouched: highlighting reads text content client-side;
no new server-side markup surface.
Acceptance criteria
Symptom
Fenced code blocks in lessons render monochrome: a
```javafence shows the language-tagged markup the renderer already emits
(
<code class="language-java">, kept through sanitization sinceADR-0013 exactly for this), but no highlighter exists to color it.
Design (summary; full decision in ADR-0017)
Same shape as the Mermaid decision (ADR-0016): the server keeps
shipping sanitized, text-only code blocks; the browser upgrades them.
org.webjars.npm:highlightjs__cdn-assetsWebJar (the plainhighlight.jswebjar ships no browser bundle since v11), versionpinned, no CDN.
lesson-highlight.jsloads the bundle only when the lessoncontains a
language-*block other thanlanguage-mermaid.stay monochrome; no auto-detect guessing.
existing surface-safe accent tokens, so both themes pass WCAG AA by
the contrast-audit proof.
no new server-side markup surface.
Acceptance criteria
colored tokens on the lesson page, in both themes.
are untouched (the diagram feature owns them).
language-javasurvivessanitization) stays green; no sanitizer change.
and Checkstyle stay green.