memos/web/src/components/MemoContent
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
..
CodeBlock.tsx refactor(web): improve MemoContent security and maintainability 2025-12-02 22:45:22 +08:00
ConditionalComponent.tsx chore: tweak comments 2025-11-30 13:16:02 +08:00
MemoContentContext.tsx chore: tweak comments 2025-11-30 13:16:02 +08:00
MermaidBlock.tsx refactor(web): improve MemoContent security and maintainability 2025-12-02 22:45:22 +08:00
Tag.tsx fix(web): allow only one active tag filter at a time 2025-12-02 08:40:43 +08:00
TaskListItem.tsx chore: tweak comments 2025-11-30 13:16:02 +08:00
constants.ts refactor(web): improve MemoContent security and maintainability 2025-12-02 22:45:22 +08:00
hooks.ts refactor: implement MemoView component with subcomponents and hooks 2025-11-29 23:21:35 +08:00
index.tsx refactor(web): improve MemoContent security and maintainability 2025-12-02 22:45:22 +08:00
types.ts refactor: implement MemoView component with subcomponents and hooks 2025-11-29 23:21:35 +08:00
utils.ts refactor(web): improve MemoContent security and maintainability 2025-12-02 22:45:22 +08:00