Document hardened {@html} handling

This commit is contained in:
Rūdolfs Ošiņš
2026-10-05 10:46:32 +02:00
parent 23b2f4645e
commit 6719f0c7fe
+7
View File
@@ -119,6 +119,13 @@ crates and files in each.
- Loading states: `{#await promise}` blocks for inline async;
local `loading` boolean with `try/catch` for imperative fetches
### `{@html}` and untrusted data (XSS)
- Avoid `{@html}` with backend-derived data (branch/ref names, aliases,
descriptions); when unavoidable, its argument must be DOMPurify-sanitized
(`sanitizeConfig` in `lib/markdown.ts`) or built from `escape()`'d parts, in
the component that renders it.
### TypeScript / HTTP client
- Derive types from Zod schemas (`z.infer<typeof fooSchema>`), never