fix: keep redaction marks correct with custom masks, Prism and Mermaid

- The mask from /api/options is stored once loaded; code markers and
  rendered Markdown are refreshed when it arrives instead of keeping the
  XXXX default.
- Mermaid sources are left untouched so diagrams still parse.
- Fenced code blocks are marked from a Prism complete hook, after Prism
  has rewritten their HTML.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
tdurieuxandClaude Opus 5.5 committed 2026-10-08 14:46:13 +02:00
1 parent 80944954d6
commit be2f979296
6 files changed
+71 -29

No files matched your search

+2 -1
View File
@@ -82,7 +82,8 @@ export function mountApplication(target = "#app", options = {}) {
root.window = window;
root.Math = Math;
root.sanitize = value => DOMPurify.sanitize(value ?? "");
root.highlightRedactions = html => highlightRedactions(html, root.site_options?.ANONYMIZATION_MASK);
// Reading site_options re-renders Markdown once the configured mask loads.
root.highlightRedactions = html => (root.site_options, highlightRedactions(html));
root.submitForm = submitForm;
root.safeUrl = safeUrl;
const context = services();