memos/web
Steven 4668c4714b refactor(web): improve MemoContent security and maintainability
Security improvements:
- Add rehype-sanitize for XSS protection in markdown content
- Remove DOMPurify and deprecated __html code block feature
- Extract sanitize schema to constants with comprehensive documentation

Maintainability improvements:
- Extract SANITIZE_SCHEMA to constants.ts for better organization
- Create utils.ts with shared code extraction utilities
- Refactor CodeBlock and MermaidBlock to use shared utilities
- Rename PreProps to CodeBlockProps for clarity
- Reduce code duplication across components

Dependency cleanup:
- Remove explicit katex dependency (now transitive via rehype-katex)
- Remove @matejmazur/react-katex (unused)
- Remove dompurify (replaced by rehype-sanitize)
- Update vite config to remove katex-vendor chunk

Changes: 7 files changed, 84 insertions(+), 100 deletions(-)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-02 22:45:22 +08:00
..
public chore: enhance site.webmanifest in firefox (#4828) 2025-07-08 19:56:46 +08:00
src refactor(web): improve MemoContent security and maintainability 2025-12-02 22:45:22 +08:00
.gitignore chore: update gitignore 2025-04-17 23:11:36 +08:00
biome.json chore(web): migrate from ESLint+Prettier to Biome 2025-11-14 23:58:07 +08:00
components.json feat: themes (#4824) 2025-07-07 20:13:22 +08:00
index.html chore: remove fixed theme color 2025-07-15 23:26:07 +08:00
package.json refactor(web): improve MemoContent security and maintainability 2025-12-02 22:45:22 +08:00
pnpm-lock.yaml refactor(web): improve MemoContent security and maintainability 2025-12-02 22:45:22 +08:00
tsconfig.json refactor: update import prefix with alias (#1433) 2023-04-01 16:03:14 +08:00
vite.config.mts refactor(web): improve MemoContent security and maintainability 2025-12-02 22:45:22 +08:00