mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-10-18 19:30:27 +08:00
Document hardened {@html} handling
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user