Skip to content

Commit 818d0cf

Browse files
[docs] clarify HTML sanitization guideline - addresses @webfiltered's review feedback
Replace vague "sanitize" wording with specific guidance on using DOMPurify and validating trusted sources when using v-html directive
1 parent a17090e commit 818d0cf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

CLAUDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
- Templates: `api.fileURL('/templates/default.json')`
5353
- Extensions: `api.fileURL(extensionPath)` for loading JS modules
5454
- Any static assets that exist in the public directory
55-
- Sanitize dynamically generated HTML content or use templates instead of v-html
55+
- When implementing code that outputs raw HTML (e.g., using v-html directive), always ensure dynamic content has been properly sanitized with DOMPurify or validated through trusted sources. Prefer Vue templates over v-html when possible.
5656
- For any async operations (API calls, timers, etc), implement cleanup/cancellation in component unmount to prevent memory leaks
5757
- Extract complex template conditionals into separate components or computed properties
5858
- Error messages should be actionable and user-friendly (e.g., "Failed to load data. Please refresh the page." instead of "Unknown error")

0 commit comments

Comments
 (0)