memos/web/src/components
andrigamerita d264f45979
fix: code blocks of unknown languages cause HTML injection (#3711)
* fix: code blocks of unknown languages cause HTML injection

A code block of unknown language (that is, a language not treated as special by Memos and not handled by highlight.js) should fall back on rendering its plaintext content. However, the content is never properly escaped before it is appended to the DOM, and thus any string that happens to contain HTML is unsafely rendered. This commit fixes the issue by ensuring that, when none of the previous cases handle the text, any HTML entities are escaped first.

* Update CodeBlock.tsx to conform to eslint
2024-07-19 08:32:58 +08:00
..
Dialog chore: update confirm dialog 2024-07-01 23:22:39 +08:00
ExploreSidebar feat: implement memo detail sidebar 2024-07-01 23:06:10 +08:00
HomeSidebar chore: tweak embeded memo style 2024-07-17 22:48:22 +08:00
Inbox chore: replace classnames with clsx 2024-04-28 00:58:40 +08:00
MemoContent fix: code blocks of unknown languages cause HTML injection (#3711) 2024-07-19 08:32:58 +08:00
MemoDetailSidebar chore: add properties to memo detail sidebar 2024-07-08 23:14:00 +08:00
MemoEditor chore: update memo relation list 2024-07-17 21:40:43 +08:00
Settings chore: update disallow public visibility setting name (#3687) 2024-07-14 20:23:19 +08:00
TimelineSidebar feat: implement memo detail sidebar 2024-07-01 23:06:10 +08:00
kit chore: replace classnames with clsx 2024-04-28 00:58:40 +08:00
ui chore: fix popover z-index 2024-07-17 20:28:31 +08:00
ActivityCalendar.tsx chore: tweak common function 2024-05-26 11:02:23 +08:00
AppearanceSelect.tsx feat: add typeScript support to enforce valid translation keys (#1954) 2023-07-15 10:27:37 +08:00
ChangeMemberPasswordDialog.tsx refactor: api version 2024-04-28 00:44:29 +08:00
ChangePasswordDialog.tsx chore: retire legacy setting api 2024-04-12 08:32:54 +08:00
CreateAccessTokenDialog.tsx chore: update frontend dependencies 2024-01-27 17:28:06 +08:00
CreateIdentityProviderDialog.tsx fix: list idp 2024-05-14 07:04:17 +08:00
CreateMemoRelationDialog.tsx feat: add snippet field to memo message (#3689) 2024-07-15 08:08:08 +08:00
CreateWebhookDialog.tsx chore: fix linter 2024-04-27 23:36:57 +08:00
Empty.tsx chore: update empty icon 2023-10-05 15:52:16 +08:00
Icon.tsx chore: fix dependencies 2024-04-10 23:34:29 +08:00
LearnMore.tsx refactor: update memo tags 2024-05-08 20:03:01 +08:00
LocaleSelect.tsx chore: tweak i18n locale 2024-03-04 23:23:14 +08:00
MemoActionMenu.tsx feat: implement inline memo editor 2024-07-17 21:07:36 +08:00
MemoReactionListView.tsx refactor: api version 2024-04-28 00:44:29 +08:00
MemoRelationListView.tsx chore: update memo relation list 2024-07-17 21:40:43 +08:00
MemoResource.tsx refactor: api version 2024-04-28 00:44:29 +08:00
MemoResourceListView.tsx chore: tweak max width 2024-05-07 22:10:08 +08:00
MemoView.tsx feat: implement inline memo editor 2024-07-17 21:07:36 +08:00
MobileHeader.tsx chore: replace classnames with clsx 2024-04-28 00:58:40 +08:00
Navigation.tsx chore: replace classnames with clsx 2024-04-28 00:58:40 +08:00
NavigationDrawer.tsx chore: tweak home style 2024-01-12 08:08:24 +08:00
PreviewImageDialog.tsx chore: update frontend dependencies 2024-01-27 17:28:06 +08:00
PreviewMarkdownDialog.tsx refactor: add markdown service 2024-04-29 08:00:37 +08:00
ReactionSelector.tsx chore: replace classnames with clsx 2024-04-28 00:58:40 +08:00
ReactionView.tsx chore: replace classnames with clsx 2024-04-28 00:58:40 +08:00
RenameTagDialog.tsx chore: update fetch tags args (#3515) 2024-06-05 08:06:01 +08:00
RequiredBadge.tsx chore: remove {filetype} in path template (#1377) 2023-03-18 22:06:15 +08:00
ResourceIcon.tsx chore: update resource dashboard 2024-05-06 07:37:48 +08:00
SearchBar.tsx chore: tweak searchbar styles 2024-05-08 22:50:13 +08:00
TagTree.tsx chore: introduce tag view option 2024-07-15 22:55:59 +08:00
UpdateAccountDialog.tsx refactor: api version 2024-04-28 00:44:29 +08:00
UpdateCustomizedProfileDialog.tsx chore: tweak naming 2024-05-13 20:03:04 +08:00
UserAvatar.tsx chore: replace classnames with clsx 2024-04-28 00:58:40 +08:00
UserBanner.tsx chore: replace classnames with clsx 2024-04-28 00:58:40 +08:00
UserStatisticsView.tsx feat: implement memo detail sidebar 2024-07-01 23:06:10 +08:00
VisibilityIcon.tsx chore: replace classnames with clsx 2024-04-28 00:58:40 +08:00