memos/web/src/components
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
..
ActivityCalendar refactor: rename workspace to instance throughout codebase 2025-11-05 23:35:35 +08:00
ConfirmDialog chore: tweak comments 2025-11-30 13:16:02 +08:00
Inbox feat(web): enhance inbox notifications and user profile layouts 2025-11-06 08:41:30 +08:00
MasonryView chore: tweak comments 2025-11-30 13:16:02 +08:00
MemoActionMenu chore: tweak comments 2025-11-30 13:16:02 +08:00
MemoContent refactor(web): improve MemoContent security and maintainability 2025-12-02 22:45:22 +08:00
MemoDetailSidebar chore(web): migrate from ESLint+Prettier to Biome 2025-11-14 23:58:07 +08:00
MemoEditor fix(web): fix infinite loop in MemoEditor and improve React/MobX integration 2025-12-01 08:54:40 +08:00
MemoExplorer fix(web): allow only one active tag filter at a time 2025-12-02 08:40:43 +08:00
MemoReactionListView chore: reorganize reaction components 2025-11-30 12:48:21 +08:00
MemoRelationForceGraph refactor: unify theme and apperance 2025-08-17 11:27:59 +08:00
MemoView chore: tweak comments 2025-11-30 13:16:02 +08:00
PagedMemoList refactor(web): optimize memo statistics fetching by using cached data from memo store 2025-11-24 21:37:12 +08:00
Settings refactor: simplify theme/locale to user preferences and improve initialization 2025-12-02 09:08:46 +08:00
StatisticsView chore: tweak comments 2025-11-30 13:16:02 +08:00
kit chore(web): migrate from ESLint+Prettier to Biome 2025-11-14 23:58:07 +08:00
memo-metadata chore: tweak comments 2025-11-30 13:16:02 +08:00
ui chore: tweak comments 2025-11-30 13:16:02 +08:00
AttachmentIcon.tsx chore(web): migrate from ESLint+Prettier to Biome 2025-11-14 23:58:07 +08:00
AuthFooter.tsx refactor: simplify theme/locale to user preferences and improve initialization 2025-12-02 09:08:46 +08:00
ChangeMemberPasswordDialog.tsx fix: dialog state 2025-07-17 21:58:00 +08:00
CreateAccessTokenDialog.tsx feat(web): add accessible ConfirmDialog and migrate confirmations; and Markdown-safe descriptions (#5111) 2025-10-09 00:40:08 +08:00
CreateIdentityProviderDialog.tsx fix: reset state on dialog close and improve dialog open handling 2025-09-17 21:51:46 +08:00
CreateShortcutDialog.tsx chore: tweak docs 2025-08-27 21:35:04 +08:00
CreateUserDialog.tsx fix: dialog state 2025-07-17 21:58:00 +08:00
CreateWebhookDialog.tsx chore: update user settings 2025-07-27 23:12:42 +08:00
DateTimeInput.tsx chore: use input type `datetime-local` instead of `text` (#5174) 2025-10-22 09:04:37 +08:00
Empty.tsx feat: variant colors (#4816) 2025-07-04 23:03:13 +08:00
LeafletMap.tsx fix(web): resolve Leaflet DOM cleanup error causing app crashes 2025-11-19 22:21:01 +08:00
LearnMore.tsx feat: variant colors (#4816) 2025-07-04 23:03:13 +08:00
LocaleSelect.tsx feat(web): add quick language and theme switchers to user menu 2025-10-28 22:32:25 +08:00
MemoAttachment.tsx fix: Midi files show up as playable (#4991) 2025-08-10 14:23:41 +08:00
MemoDisplaySettingMenu.tsx chore: move frontend store 2025-07-07 22:44:08 +08:00
MemoFilters.tsx refactor(web): refactor MemoFilters component and add comprehensive filter support 2025-10-30 22:52:58 +08:00
MemoResource.tsx refactor: attachment service part2 2025-06-18 00:09:19 +08:00
MemoSkeleton.tsx refactor(web): improve memo component skeleton and loading states 2025-10-30 22:25:19 +08:00
MemosLogo.tsx refactor: rename workspace to instance throughout codebase 2025-11-05 23:35:35 +08:00
MobileHeader.tsx feat: variant colors (#4816) 2025-07-04 23:03:13 +08:00
Navigation.tsx refactor(api): migrate inbox functionality to user notifications 2025-10-31 08:33:09 +08:00
NavigationDrawer.tsx refactor: rename workspace to instance throughout codebase 2025-11-05 23:35:35 +08:00
PasswordSignInForm.tsx refactor: rename workspace to instance throughout codebase 2025-11-05 23:35:35 +08:00
PreviewImageDialog.tsx feat: allow closing image preview via backdrop click (#5243) 2025-11-10 19:12:45 +08:00
RequiredBadge.tsx feat: variant colors (#4816) 2025-07-04 23:03:13 +08:00
SearchBar.tsx fix: keyboard shortcuts (#5250) 2025-11-17 08:55:57 +08:00
TagTree.tsx fix(web): allow only one active tag filter at a time 2025-12-02 08:40:43 +08:00
ThemeSelect.tsx refactor: simplify theme/locale to user preferences and improve initialization 2025-12-02 09:08:46 +08:00
UpdateAccountDialog.tsx chore(web): migrate from ESLint+Prettier to Biome 2025-11-14 23:58:07 +08:00
UpdateCustomizedProfileDialog.tsx refactor: simplify theme/locale to user preferences and improve initialization 2025-12-02 09:08:46 +08:00
UserAvatar.tsx chore: unify colors 2025-07-06 13:55:08 +08:00
UserMenu.tsx refactor: simplify theme/locale to user preferences and improve initialization 2025-12-02 09:08:46 +08:00
VisibilityIcon.tsx feat: variant colors (#4816) 2025-07-04 23:03:13 +08:00