Skip to content

Commit fe3b12a

Browse files
committed
docs: sanitizationconfig tweak
1 parent a9979f0 commit fe3b12a

2 files changed

Lines changed: 14 additions & 10 deletions

File tree

docs/docs/api-reference/enriched-text-input.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -608,11 +608,13 @@ interface SanitizationConfig {
608608
```
609609

610610
- `linkRegex` - a regular expression deciding which link URIs survive
611-
sanitization. It maps directly to DOMPurify's
612-
[`ALLOWED_URI_REGEXP`](https://github.com/cure53/DOMPurify#can-i-configure-dompurify),
613-
so it **replaces** the default allow-list rather than extending it. Include the
614-
standard protocols you still want to permit alongside any custom scheme. When omitted,
615-
DOMPurify's built-in default is used.
611+
sanitization.
612+
613+
:::caution
614+
615+
`linkRegex` maps directly to DOMPurify's [`ALLOWED_URI_REGEXP`](https://github.com/cure53/DOMPurify#can-i-configure-dompurify), so it **replaces** the default allow-list rather than extending it. Because this regex affects all URI-containing attributes (e.g. `src` in `<img>`), remember to keep the standard protocols you still want to permit.
616+
617+
:::
616618

617619
```tsx
618620
<EnrichedTextInput

docs/docs/api-reference/enriched-text.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,13 @@ interface SanitizationConfig {
104104
```
105105

106106
- `linkRegex` - a regular expression deciding which link URIs survive
107-
sanitization. It maps directly to DOMPurify's
108-
[`ALLOWED_URI_REGEXP`](https://github.com/cure53/DOMPurify#can-i-configure-dompurify),
109-
so it **replaces** the default allow-list rather than extending it. Include the
110-
standard protocols you still want to permit alongside any custom scheme. When omitted,
111-
DOMPurify's built-in default is used.
107+
sanitization.
108+
109+
:::caution
110+
111+
`linkRegex` maps directly to DOMPurify's [`ALLOWED_URI_REGEXP`](https://github.com/cure53/DOMPurify#can-i-configure-dompurify), so it **replaces** the default allow-list rather than extending it. Because this regex affects all URI-containing attributes (e.g. `src` in `<img>`), remember to keep the standard protocols you still want to permit.
112+
113+
:::
112114

113115
```tsx
114116
<EnrichedText

0 commit comments

Comments
 (0)