mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-10-19 22:27:20 +02:00
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:
1 parent
80944954d6
commit
be2f979296
6 files changed
+71
-29
No files matched your search
@@ -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();
|
||||
|
||||
Reference in new issue
Block a user