Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
canifa_note
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Vũ Hoàng Anh
canifa_note
Commits
e8ed437c
Commit
e8ed437c
authored
Jun 04, 2024
by
Steven
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: purify html before render
parent
2b49025f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
86 additions
and
61 deletions
+86
-61
package.json
web/package.json
+1
-0
pnpm-lock.yaml
web/pnpm-lock.yaml
+82
-60
CodeBlock.tsx
web/src/components/MemoContent/CodeBlock.tsx
+3
-1
No files found.
web/package.json
View file @
e8ed437c
...
@@ -21,6 +21,7 @@
...
@@ -21,6 +21,7 @@
"clsx"
:
"^2.1.1"
,
"clsx"
:
"^2.1.1"
,
"copy-to-clipboard"
:
"^3.3.3"
,
"copy-to-clipboard"
:
"^3.3.3"
,
"dayjs"
:
"^1.11.11"
,
"dayjs"
:
"^1.11.11"
,
"dompurify"
:
"^3.1.5"
,
"fuse.js"
:
"^7.0.0"
,
"fuse.js"
:
"^7.0.0"
,
"highlight.js"
:
"^11.9.0"
,
"highlight.js"
:
"^11.9.0"
,
"i18next"
:
"^23.11.5"
,
"i18next"
:
"^23.11.5"
,
...
...
web/pnpm-lock.yaml
View file @
e8ed437c
...
@@ -10,10 +10,10 @@ importers:
...
@@ -10,10 +10,10 @@ importers:
dependencies
:
dependencies
:
'
@dnd-kit/core'
:
'
@dnd-kit/core'
:
specifier
:
^6.1.0
specifier
:
^6.1.0
version
:
6.1.0(react-dom@18.3.1)(react@18.3.1)
version
:
6.1.0(react-dom@18.3.1
(react@18.3.1)
)(react@18.3.1)
'
@dnd-kit/sortable'
:
'
@dnd-kit/sortable'
:
specifier
:
^8.0.0
specifier
:
^8.0.0
version
:
8.0.0(@dnd-kit/core@6.1.0)(react@18.3.1)
version
:
8.0.0(@dnd-kit/core@6.1.0
(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
)(react@18.3.1)
'
@dnd-kit/utilities'
:
'
@dnd-kit/utilities'
:
specifier
:
^3.2.2
specifier
:
^3.2.2
version
:
3.2.2(react@18.3.1)
version
:
3.2.2(react@18.3.1)
...
@@ -22,7 +22,7 @@ importers:
...
@@ -22,7 +22,7 @@ importers:
version
:
11.11.4(@types/react@18.3.3)(react@18.3.1)
version
:
11.11.4(@types/react@18.3.3)(react@18.3.1)
'
@emotion/styled'
:
'
@emotion/styled'
:
specifier
:
^11.11.5
specifier
:
^11.11.5
version
:
11.11.5(@emotion/react@11.11.4)(@types/react@18.3.3)(react@18.3.1)
version
:
11.11.5(@emotion/react@11.11.4
(@types/react@18.3.3)(react@18.3.1)
)(@types/react@18.3.3)(react@18.3.1)
'
@github/relative-time-element'
:
'
@github/relative-time-element'
:
specifier
:
^4.4.0
specifier
:
^4.4.0
version
:
4.4.0
version
:
4.4.0
...
@@ -31,10 +31,10 @@ importers:
...
@@ -31,10 +31,10 @@ importers:
version
:
3.1.3(katex@0.16.10)(react@18.3.1)
version
:
3.1.3(katex@0.16.10)(react@18.3.1)
'
@mui/joy'
:
'
@mui/joy'
:
specifier
:
5.0.0-beta.36
specifier
:
5.0.0-beta.36
version
:
5.0.0-beta.36(@emotion/react@11.11.4
)(@emotion/styled@11.11.5)(@types/react@18.3.3)(react-dom@18.3.1
)(react@18.3.1)
version
:
5.0.0-beta.36(@emotion/react@11.11.4
(@types/react@18.3.3)(react@18.3.1))(@emotion/styled@11.11.5(@emotion/react@11.11.4(@types/react@18.3.3)(react@18.3.1))(@types/react@18.3.3)(react@18.3.1))(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1)
)(react@18.3.1)
'
@reduxjs/toolkit'
:
'
@reduxjs/toolkit'
:
specifier
:
^2.2.4
specifier
:
^2.2.4
version
:
2.2.5(react-redux@9.1.2)(react@18.3.1)
version
:
2.2.5(react-redux@9.1.2
(@types/react@18.3.3)(react@18.3.1)(redux@5.0.1)
)(react@18.3.1)
clsx
:
clsx
:
specifier
:
^2.1.1
specifier
:
^2.1.1
version
:
2.1.1
version
:
2.1.1
...
@@ -44,6 +44,9 @@ importers:
...
@@ -44,6 +44,9 @@ importers:
dayjs
:
dayjs
:
specifier
:
^1.11.11
specifier
:
^1.11.11
version
:
1.11.11
version
:
1.11.11
dompurify
:
specifier
:
^3.1.5
version
:
3.1.5
fuse.js
:
fuse.js
:
specifier
:
^7.0.0
specifier
:
^7.0.0
version
:
7.0.0
version
:
7.0.0
...
@@ -73,19 +76,19 @@ importers:
...
@@ -73,19 +76,19 @@ importers:
version
:
18.3.1(react@18.3.1)
version
:
18.3.1(react@18.3.1)
react-hot-toast
:
react-hot-toast
:
specifier
:
^2.4.1
specifier
:
^2.4.1
version
:
2.4.1(csstype@3.1.3)(react-dom@18.3.1)(react@18.3.1)
version
:
2.4.1(csstype@3.1.3)(react-dom@18.3.1
(react@18.3.1)
)(react@18.3.1)
react-i18next
:
react-i18next
:
specifier
:
^14.1.1
specifier
:
^14.1.1
version
:
14.1.2(i18next@23.11.5)(react-dom@18.3.1)(react@18.3.1)
version
:
14.1.2(i18next@23.11.5)(react-dom@18.3.1
(react@18.3.1)
)(react@18.3.1)
react-redux
:
react-redux
:
specifier
:
^9.1.2
specifier
:
^9.1.2
version
:
9.1.2(@types/react@18.3.3)(react@18.3.1)(redux@5.0.1)
version
:
9.1.2(@types/react@18.3.3)(react@18.3.1)(redux@5.0.1)
react-router-dom
:
react-router-dom
:
specifier
:
^6.23.1
specifier
:
^6.23.1
version
:
6.23.1(react-dom@18.3.1)(react@18.3.1)
version
:
6.23.1(react-dom@18.3.1
(react@18.3.1)
)(react@18.3.1)
react-use
:
react-use
:
specifier
:
^17.5.0
specifier
:
^17.5.0
version
:
17.5.0(react-dom@18.3.1)(react@18.3.1)
version
:
17.5.0(react-dom@18.3.1
(react@18.3.1)
)(react@18.3.1)
tailwindcss
:
tailwindcss
:
specifier
:
^3.4.3
specifier
:
^3.4.3
version
:
3.4.3
version
:
3.4.3
...
@@ -97,7 +100,7 @@ importers:
...
@@ -97,7 +100,7 @@ importers:
version
:
9.0.1
version
:
9.0.1
zustand
:
zustand
:
specifier
:
^4.5.2
specifier
:
^4.5.2
version
:
4.5.2(@types/react@18.3.3)(react@18.3.1)
version
:
4.5.2(@types/react@18.3.3)(
immer@10.1.1)(
react@18.3.1)
devDependencies
:
devDependencies
:
'
@bufbuild/buf'
:
'
@bufbuild/buf'
:
specifier
:
^1.32.1
specifier
:
^1.32.1
...
@@ -137,13 +140,13 @@ importers:
...
@@ -137,13 +140,13 @@ importers:
version
:
9.0.8
version
:
9.0.8
'
@typescript-eslint/eslint-plugin'
:
'
@typescript-eslint/eslint-plugin'
:
specifier
:
^7.8.0
specifier
:
^7.8.0
version
:
7.11.0(@typescript-eslint/parser@7.11.0)(eslint@8.57.0)(typescript@5.4.5)
version
:
7.11.0(@typescript-eslint/parser@7.11.0
(eslint@8.57.0)(typescript@5.4.5)
)(eslint@8.57.0)(typescript@5.4.5)
'
@typescript-eslint/parser'
:
'
@typescript-eslint/parser'
:
specifier
:
^7.10.0
specifier
:
^7.10.0
version
:
7.11.0(eslint@8.57.0)(typescript@5.4.5)
version
:
7.11.0(eslint@8.57.0)(typescript@5.4.5)
'
@vitejs/plugin-react'
:
'
@vitejs/plugin-react'
:
specifier
:
^4.3.0
specifier
:
^4.3.0
version
:
4.3.0(vite@5.2.12)
version
:
4.3.0(vite@5.2.12
(@types/node@20.14.0)(less@4.2.0)
)
autoprefixer
:
autoprefixer
:
specifier
:
^10.4.19
specifier
:
^10.4.19
version
:
10.4.19(postcss@8.4.38)
version
:
10.4.19(postcss@8.4.38)
...
@@ -155,7 +158,7 @@ importers:
...
@@ -155,7 +158,7 @@ importers:
version
:
9.1.0(eslint@8.57.0)
version
:
9.1.0(eslint@8.57.0)
eslint-plugin-prettier
:
eslint-plugin-prettier
:
specifier
:
^5.1.3
specifier
:
^5.1.3
version
:
5.1.3(eslint-config-prettier@9.1.0)(eslint@8.57.0)(prettier@3.3.0)
version
:
5.1.3(eslint-config-prettier@9.1.0
(eslint@8.57.0)
)(eslint@8.57.0)(prettier@3.3.0)
eslint-plugin-react
:
eslint-plugin-react
:
specifier
:
^7.34.1
specifier
:
^7.34.1
version
:
7.34.2(eslint@8.57.0)
version
:
7.34.2(eslint@8.57.0)
...
@@ -3265,7 +3268,7 @@ snapshots:
...
@@ -3265,7 +3268,7 @@ snapshots:
react
:
18.3.1
react
:
18.3.1
tslib
:
2.6.2
tslib
:
2.6.2
'
@dnd-kit/core@6.1.0(react-dom@18.3.1)(react@18.3.1)'
:
'
@dnd-kit/core@6.1.0(react-dom@18.3.1
(react@18.3.1)
)(react@18.3.1)'
:
dependencies
:
dependencies
:
'
@dnd-kit/accessibility'
:
3.1.0(react@18.3.1)
'
@dnd-kit/accessibility'
:
3.1.0(react@18.3.1)
'
@dnd-kit/utilities'
:
3.2.2(react@18.3.1)
'
@dnd-kit/utilities'
:
3.2.2(react@18.3.1)
...
@@ -3273,9 +3276,9 @@ snapshots:
...
@@ -3273,9 +3276,9 @@ snapshots:
react-dom
:
18.3.1(react@18.3.1)
react-dom
:
18.3.1(react@18.3.1)
tslib
:
2.6.2
tslib
:
2.6.2
'
@dnd-kit/sortable@8.0.0(@dnd-kit/core@6.1.0)(react@18.3.1)'
:
'
@dnd-kit/sortable@8.0.0(@dnd-kit/core@6.1.0
(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
)(react@18.3.1)'
:
dependencies
:
dependencies
:
'
@dnd-kit/core'
:
6.1.0(react-dom@18.3.1)(react@18.3.1)
'
@dnd-kit/core'
:
6.1.0(react-dom@18.3.1
(react@18.3.1)
)(react@18.3.1)
'
@dnd-kit/utilities'
:
3.2.2(react@18.3.1)
'
@dnd-kit/utilities'
:
3.2.2(react@18.3.1)
react
:
18.3.1
react
:
18.3.1
tslib
:
2.6.2
tslib
:
2.6.2
...
@@ -3324,9 +3327,10 @@ snapshots:
...
@@ -3324,9 +3327,10 @@ snapshots:
'
@emotion/use-insertion-effect-with-fallbacks'
:
1.0.1(react@18.3.1)
'
@emotion/use-insertion-effect-with-fallbacks'
:
1.0.1(react@18.3.1)
'
@emotion/utils'
:
1.2.1
'
@emotion/utils'
:
1.2.1
'
@emotion/weak-memoize'
:
0.3.1
'
@emotion/weak-memoize'
:
0.3.1
'
@types/react'
:
18.3.3
hoist-non-react-statics
:
3.3.2
hoist-non-react-statics
:
3.3.2
react
:
18.3.1
react
:
18.3.1
optionalDependencies
:
'
@types/react'
:
18.3.3
'
@emotion/serialize@1.1.4'
:
'
@emotion/serialize@1.1.4'
:
dependencies
:
dependencies
:
...
@@ -3338,7 +3342,7 @@ snapshots:
...
@@ -3338,7 +3342,7 @@ snapshots:
'
@emotion/sheet@1.2.2'
:
{}
'
@emotion/sheet@1.2.2'
:
{}
'
@emotion/styled@11.11.5(@emotion/react@11.11.4)(@types/react@18.3.3)(react@18.3.1)'
:
'
@emotion/styled@11.11.5(@emotion/react@11.11.4
(@types/react@18.3.3)(react@18.3.1)
)(@types/react@18.3.3)(react@18.3.1)'
:
dependencies
:
dependencies
:
'
@babel/runtime'
:
7.24.6
'
@babel/runtime'
:
7.24.6
'
@emotion/babel-plugin'
:
11.11.0
'
@emotion/babel-plugin'
:
11.11.0
...
@@ -3347,8 +3351,9 @@ snapshots:
...
@@ -3347,8 +3351,9 @@ snapshots:
'
@emotion/serialize'
:
1.1.4
'
@emotion/serialize'
:
1.1.4
'
@emotion/use-insertion-effect-with-fallbacks'
:
1.0.1(react@18.3.1)
'
@emotion/use-insertion-effect-with-fallbacks'
:
1.0.1(react@18.3.1)
'
@emotion/utils'
:
1.2.1
'
@emotion/utils'
:
1.2.1
'
@types/react'
:
18.3.3
react
:
18.3.1
react
:
18.3.1
optionalDependencies
:
'
@types/react'
:
18.3.3
'
@emotion/unitless@0.8.1'
:
{}
'
@emotion/unitless@0.8.1'
:
{}
...
@@ -3461,7 +3466,7 @@ snapshots:
...
@@ -3461,7 +3466,7 @@ snapshots:
'
@floating-ui/core'
:
1.6.2
'
@floating-ui/core'
:
1.6.2
'
@floating-ui/utils'
:
0.2.2
'
@floating-ui/utils'
:
0.2.2
'
@floating-ui/react-dom@2.1.0(react-dom@18.3.1)(react@18.3.1)'
:
'
@floating-ui/react-dom@2.1.0(react-dom@18.3.1
(react@18.3.1)
)(react@18.3.1)'
:
dependencies
:
dependencies
:
'
@floating-ui/dom'
:
1.6.5
'
@floating-ui/dom'
:
1.6.5
react
:
18.3.1
react
:
18.3.1
...
@@ -3514,82 +3519,88 @@ snapshots:
...
@@ -3514,82 +3519,88 @@ snapshots:
katex
:
0.16.10
katex
:
0.16.10
react
:
18.3.1
react
:
18.3.1
'
@mui/base@5.0.0-beta.42(@types/react@18.3.3)(react-dom@18.3.1)(react@18.3.1)'
:
'
@mui/base@5.0.0-beta.42(@types/react@18.3.3)(react-dom@18.3.1
(react@18.3.1)
)(react@18.3.1)'
:
dependencies
:
dependencies
:
'
@babel/runtime'
:
7.24.6
'
@babel/runtime'
:
7.24.6
'
@floating-ui/react-dom'
:
2.1.0(react-dom@18.3.1)(react@18.3.1)
'
@floating-ui/react-dom'
:
2.1.0(react-dom@18.3.1
(react@18.3.1)
)(react@18.3.1)
'
@mui/types'
:
7.2.14(@types/react@18.3.3)
'
@mui/types'
:
7.2.14(@types/react@18.3.3)
'
@mui/utils'
:
6.0.0-dev.20240529-082515-213b5e33ab(@types/react@18.3.3)(react@18.3.1)
'
@mui/utils'
:
6.0.0-dev.20240529-082515-213b5e33ab(@types/react@18.3.3)(react@18.3.1)
'
@popperjs/core'
:
2.11.8
'
@popperjs/core'
:
2.11.8
'
@types/react'
:
18.3.3
clsx
:
2.1.1
clsx
:
2.1.1
prop-types
:
15.8.1
prop-types
:
15.8.1
react
:
18.3.1
react
:
18.3.1
react-dom
:
18.3.1(react@18.3.1)
react-dom
:
18.3.1(react@18.3.1)
optionalDependencies
:
'
@types/react'
:
18.3.3
'
@mui/core-downloads-tracker@6.0.0-dev.240424162023-9968b4889d'
:
{}
'
@mui/core-downloads-tracker@6.0.0-dev.240424162023-9968b4889d'
:
{}
'
@mui/joy@5.0.0-beta.36(@emotion/react@11.11.4
)(@emotion/styled@11.11.5)(@types/react@18.3.3)(react-dom@18.3.1
)(react@18.3.1)'
:
'
@mui/joy@5.0.0-beta.36(@emotion/react@11.11.4
(@types/react@18.3.3)(react@18.3.1))(@emotion/styled@11.11.5(@emotion/react@11.11.4(@types/react@18.3.3)(react@18.3.1))(@types/react@18.3.3)(react@18.3.1))(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1)
)(react@18.3.1)'
:
dependencies
:
dependencies
:
'
@babel/runtime'
:
7.24.6
'
@babel/runtime'
:
7.24.6
'
@emotion/react'
:
11.11.4(@types/react@18.3.3)(react@18.3.1)
'
@mui/base'
:
5.0.0-beta.42(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
'
@emotion/styled'
:
11.11.5(@emotion/react@11.11.4)(@types/react@18.3.3)(react@18.3.1)
'
@mui/base'
:
5.0.0-beta.42(@types/react@18.3.3)(react-dom@18.3.1)(react@18.3.1)
'
@mui/core-downloads-tracker'
:
6.0.0-dev.240424162023-9968b4889d
'
@mui/core-downloads-tracker'
:
6.0.0-dev.240424162023-9968b4889d
'
@mui/system'
:
6.0.0-dev.240424162023-9968b4889d(@emotion/react@11.11.4
)(@emotion/styled@11.11.5
)(@types/react@18.3.3)(react@18.3.1)
'
@mui/system'
:
6.0.0-dev.240424162023-9968b4889d(@emotion/react@11.11.4
(@types/react@18.3.3)(react@18.3.1))(@emotion/styled@11.11.5(@emotion/react@11.11.4(@types/react@18.3.3)(react@18.3.1))(@types/react@18.3.3)(react@18.3.1)
)(@types/react@18.3.3)(react@18.3.1)
'
@mui/types'
:
7.2.14(@types/react@18.3.3)
'
@mui/types'
:
7.2.14(@types/react@18.3.3)
'
@mui/utils'
:
6.0.0-dev.20240529-082515-213b5e33ab(@types/react@18.3.3)(react@18.3.1)
'
@mui/utils'
:
6.0.0-dev.20240529-082515-213b5e33ab(@types/react@18.3.3)(react@18.3.1)
'
@types/react'
:
18.3.3
clsx
:
2.1.1
clsx
:
2.1.1
prop-types
:
15.8.1
prop-types
:
15.8.1
react
:
18.3.1
react
:
18.3.1
react-dom
:
18.3.1(react@18.3.1)
react-dom
:
18.3.1(react@18.3.1)
optionalDependencies
:
'
@emotion/react'
:
11.11.4(@types/react@18.3.3)(react@18.3.1)
'
@emotion/styled'
:
11.11.5(@emotion/react@11.11.4(@types/react@18.3.3)(react@18.3.1))(@types/react@18.3.3)(react@18.3.1)
'
@types/react'
:
18.3.3
'
@mui/private-theming@6.0.0-dev.20240529-082515-213b5e33ab(@types/react@18.3.3)(react@18.3.1)'
:
'
@mui/private-theming@6.0.0-dev.20240529-082515-213b5e33ab(@types/react@18.3.3)(react@18.3.1)'
:
dependencies
:
dependencies
:
'
@babel/runtime'
:
7.24.6
'
@babel/runtime'
:
7.24.6
'
@mui/utils'
:
6.0.0-dev.20240529-082515-213b5e33ab(@types/react@18.3.3)(react@18.3.1)
'
@mui/utils'
:
6.0.0-dev.20240529-082515-213b5e33ab(@types/react@18.3.3)(react@18.3.1)
'
@types/react'
:
18.3.3
prop-types
:
15.8.1
prop-types
:
15.8.1
react
:
18.3.1
react
:
18.3.1
optionalDependencies
:
'
@types/react'
:
18.3.3
'
@mui/styled-engine@6.0.0-dev.20240529-082515-213b5e33ab(@emotion/react@11.11.4
)(@emotion/styled@11.11.5
)(react@18.3.1)'
:
'
@mui/styled-engine@6.0.0-dev.20240529-082515-213b5e33ab(@emotion/react@11.11.4
(@types/react@18.3.3)(react@18.3.1))(@emotion/styled@11.11.5(@emotion/react@11.11.4(@types/react@18.3.3)(react@18.3.1))(@types/react@18.3.3)(react@18.3.1)
)(react@18.3.1)'
:
dependencies
:
dependencies
:
'
@babel/runtime'
:
7.24.6
'
@babel/runtime'
:
7.24.6
'
@emotion/cache'
:
11.11.0
'
@emotion/cache'
:
11.11.0
'
@emotion/react'
:
11.11.4(@types/react@18.3.3)(react@18.3.1)
'
@emotion/styled'
:
11.11.5(@emotion/react@11.11.4)(@types/react@18.3.3)(react@18.3.1)
csstype
:
3.1.3
csstype
:
3.1.3
prop-types
:
15.8.1
prop-types
:
15.8.1
react
:
18.3.1
react
:
18.3.1
optionalDependencies
:
'
@emotion/react'
:
11.11.4(@types/react@18.3.3)(react@18.3.1)
'
@emotion/styled'
:
11.11.5(@emotion/react@11.11.4(@types/react@18.3.3)(react@18.3.1))(@types/react@18.3.3)(react@18.3.1)
'
@mui/system@6.0.0-dev.240424162023-9968b4889d(@emotion/react@11.11.4
)(@emotion/styled@11.11.5
)(@types/react@18.3.3)(react@18.3.1)'
:
'
@mui/system@6.0.0-dev.240424162023-9968b4889d(@emotion/react@11.11.4
(@types/react@18.3.3)(react@18.3.1))(@emotion/styled@11.11.5(@emotion/react@11.11.4(@types/react@18.3.3)(react@18.3.1))(@types/react@18.3.3)(react@18.3.1)
)(@types/react@18.3.3)(react@18.3.1)'
:
dependencies
:
dependencies
:
'
@babel/runtime'
:
7.24.6
'
@babel/runtime'
:
7.24.6
'
@emotion/react'
:
11.11.4(@types/react@18.3.3)(react@18.3.1)
'
@emotion/styled'
:
11.11.5(@emotion/react@11.11.4)(@types/react@18.3.3)(react@18.3.1)
'
@mui/private-theming'
:
6.0.0-dev.20240529-082515-213b5e33ab(@types/react@18.3.3)(react@18.3.1)
'
@mui/private-theming'
:
6.0.0-dev.20240529-082515-213b5e33ab(@types/react@18.3.3)(react@18.3.1)
'
@mui/styled-engine'
:
6.0.0-dev.20240529-082515-213b5e33ab(@emotion/react@11.11.4
)(@emotion/styled@11.11.5
)(react@18.3.1)
'
@mui/styled-engine'
:
6.0.0-dev.20240529-082515-213b5e33ab(@emotion/react@11.11.4
(@types/react@18.3.3)(react@18.3.1))(@emotion/styled@11.11.5(@emotion/react@11.11.4(@types/react@18.3.3)(react@18.3.1))(@types/react@18.3.3)(react@18.3.1)
)(react@18.3.1)
'
@mui/types'
:
7.2.14(@types/react@18.3.3)
'
@mui/types'
:
7.2.14(@types/react@18.3.3)
'
@mui/utils'
:
6.0.0-dev.20240529-082515-213b5e33ab(@types/react@18.3.3)(react@18.3.1)
'
@mui/utils'
:
6.0.0-dev.20240529-082515-213b5e33ab(@types/react@18.3.3)(react@18.3.1)
'
@types/react'
:
18.3.3
clsx
:
2.1.1
clsx
:
2.1.1
csstype
:
3.1.3
csstype
:
3.1.3
prop-types
:
15.8.1
prop-types
:
15.8.1
react
:
18.3.1
react
:
18.3.1
optionalDependencies
:
'
@emotion/react'
:
11.11.4(@types/react@18.3.3)(react@18.3.1)
'
@emotion/styled'
:
11.11.5(@emotion/react@11.11.4(@types/react@18.3.3)(react@18.3.1))(@types/react@18.3.3)(react@18.3.1)
'
@types/react'
:
18.3.3
'
@mui/types@7.2.14(@types/react@18.3.3)'
:
'
@mui/types@7.2.14(@types/react@18.3.3)'
:
d
ependencies
:
optionalD
ependencies
:
'
@types/react'
:
18.3.3
'
@types/react'
:
18.3.3
'
@mui/utils@6.0.0-dev.20240529-082515-213b5e33ab(@types/react@18.3.3)(react@18.3.1)'
:
'
@mui/utils@6.0.0-dev.20240529-082515-213b5e33ab(@types/react@18.3.3)(react@18.3.1)'
:
dependencies
:
dependencies
:
'
@babel/runtime'
:
7.24.6
'
@babel/runtime'
:
7.24.6
'
@types/prop-types'
:
15.7.12
'
@types/prop-types'
:
15.7.12
'
@types/react'
:
18.3.3
prop-types
:
15.8.1
prop-types
:
15.8.1
react
:
18.3.1
react
:
18.3.1
react-is
:
18.3.1
react-is
:
18.3.1
optionalDependencies
:
'
@types/react'
:
18.3.3
'
@nodelib/fs.scandir@2.1.5'
:
'
@nodelib/fs.scandir@2.1.5'
:
dependencies
:
dependencies
:
...
@@ -3633,14 +3644,15 @@ snapshots:
...
@@ -3633,14 +3644,15 @@ snapshots:
'
@protobufjs/utf8@1.1.0'
:
{}
'
@protobufjs/utf8@1.1.0'
:
{}
'
@reduxjs/toolkit@2.2.5(react-redux@9.1.2)(react@18.3.1)'
:
'
@reduxjs/toolkit@2.2.5(react-redux@9.1.2
(@types/react@18.3.3)(react@18.3.1)(redux@5.0.1)
)(react@18.3.1)'
:
dependencies
:
dependencies
:
immer
:
10.1.1
immer
:
10.1.1
react
:
18.3.1
react-redux
:
9.1.2(@types/react@18.3.3)(react@18.3.1)(redux@5.0.1)
redux
:
5.0.1
redux
:
5.0.1
redux-thunk
:
3.1.0(redux@5.0.1)
redux-thunk
:
3.1.0(redux@5.0.1)
reselect
:
5.1.1
reselect
:
5.1.1
optionalDependencies
:
react
:
18.3.1
react-redux
:
9.1.2(@types/react@18.3.3)(react@18.3.1)(redux@5.0.1)
'
@remix-run/router@1.16.1'
:
{}
'
@remix-run/router@1.16.1'
:
{}
...
@@ -3899,7 +3911,7 @@ snapshots:
...
@@ -3899,7 +3911,7 @@ snapshots:
'
@types/uuid@9.0.8'
:
{}
'
@types/uuid@9.0.8'
:
{}
'
@typescript-eslint/eslint-plugin@7.11.0(@typescript-eslint/parser@7.11.0)(eslint@8.57.0)(typescript@5.4.5)'
:
'
@typescript-eslint/eslint-plugin@7.11.0(@typescript-eslint/parser@7.11.0
(eslint@8.57.0)(typescript@5.4.5)
)(eslint@8.57.0)(typescript@5.4.5)'
:
dependencies
:
dependencies
:
'
@eslint-community/regexpp'
:
4.10.1
'
@eslint-community/regexpp'
:
4.10.1
'
@typescript-eslint/parser'
:
7.11.0(eslint@8.57.0)(typescript@5.4.5)
'
@typescript-eslint/parser'
:
7.11.0(eslint@8.57.0)(typescript@5.4.5)
...
@@ -3912,6 +3924,7 @@ snapshots:
...
@@ -3912,6 +3924,7 @@ snapshots:
ignore
:
5.3.1
ignore
:
5.3.1
natural-compare
:
1.4.0
natural-compare
:
1.4.0
ts-api-utils
:
1.3.0(typescript@5.4.5)
ts-api-utils
:
1.3.0(typescript@5.4.5)
optionalDependencies
:
typescript
:
5.4.5
typescript
:
5.4.5
transitivePeerDependencies
:
transitivePeerDependencies
:
-
supports-color
-
supports-color
...
@@ -3924,6 +3937,7 @@ snapshots:
...
@@ -3924,6 +3937,7 @@ snapshots:
'
@typescript-eslint/visitor-keys'
:
7.11.0
'
@typescript-eslint/visitor-keys'
:
7.11.0
debug
:
4.3.5
debug
:
4.3.5
eslint
:
8.57.0
eslint
:
8.57.0
optionalDependencies
:
typescript
:
5.4.5
typescript
:
5.4.5
transitivePeerDependencies
:
transitivePeerDependencies
:
-
supports-color
-
supports-color
...
@@ -3940,6 +3954,7 @@ snapshots:
...
@@ -3940,6 +3954,7 @@ snapshots:
debug
:
4.3.5
debug
:
4.3.5
eslint
:
8.57.0
eslint
:
8.57.0
ts-api-utils
:
1.3.0(typescript@5.4.5)
ts-api-utils
:
1.3.0(typescript@5.4.5)
optionalDependencies
:
typescript
:
5.4.5
typescript
:
5.4.5
transitivePeerDependencies
:
transitivePeerDependencies
:
-
supports-color
-
supports-color
...
@@ -3956,6 +3971,7 @@ snapshots:
...
@@ -3956,6 +3971,7 @@ snapshots:
minimatch
:
9.0.4
minimatch
:
9.0.4
semver
:
7.6.2
semver
:
7.6.2
ts-api-utils
:
1.3.0(typescript@5.4.5)
ts-api-utils
:
1.3.0(typescript@5.4.5)
optionalDependencies
:
typescript
:
5.4.5
typescript
:
5.4.5
transitivePeerDependencies
:
transitivePeerDependencies
:
-
supports-color
-
supports-color
...
@@ -3978,7 +3994,7 @@ snapshots:
...
@@ -3978,7 +3994,7 @@ snapshots:
'
@ungap/structured-clone@1.2.0'
:
{}
'
@ungap/structured-clone@1.2.0'
:
{}
'
@vitejs/plugin-react@4.3.0(vite@5.2.12)'
:
'
@vitejs/plugin-react@4.3.0(vite@5.2.12
(@types/node@20.14.0)(less@4.2.0)
)'
:
dependencies
:
dependencies
:
'
@babel/core'
:
7.24.6
'
@babel/core'
:
7.24.6
'
@babel/plugin-transform-react-jsx-self'
:
7.24.6(@babel/core@7.24.6)
'
@babel/plugin-transform-react-jsx-self'
:
7.24.6(@babel/core@7.24.6)
...
@@ -4642,13 +4658,14 @@ snapshots:
...
@@ -4642,13 +4658,14 @@ snapshots:
dependencies
:
dependencies
:
eslint
:
8.57.0
eslint
:
8.57.0
eslint-plugin-prettier@5.1.3(eslint-config-prettier@9.1.0)(eslint@8.57.0)(prettier@3.3.0)
:
eslint-plugin-prettier@5.1.3(eslint-config-prettier@9.1.0
(eslint@8.57.0)
)(eslint@8.57.0)(prettier@3.3.0)
:
dependencies
:
dependencies
:
eslint
:
8.57.0
eslint
:
8.57.0
eslint-config-prettier
:
9.1.0(eslint@8.57.0)
prettier
:
3.3.0
prettier
:
3.3.0
prettier-linter-helpers
:
1.0.0
prettier-linter-helpers
:
1.0.0
synckit
:
0.8.8
synckit
:
0.8.8
optionalDependencies
:
eslint-config-prettier
:
9.1.0(eslint@8.57.0)
eslint-plugin-react@7.34.2(eslint@8.57.0)
:
eslint-plugin-react@7.34.2(eslint@8.57.0)
:
dependencies
:
dependencies
:
...
@@ -5409,7 +5426,7 @@ snapshots:
...
@@ -5409,7 +5426,7 @@ snapshots:
object-assign
:
4.1.1
object-assign
:
4.1.1
thenify-all
:
1.6.0
thenify-all
:
1.6.0
nano-css@5.6.1(react-dom@18.3.1)(react@18.3.1)
:
nano-css@5.6.1(react-dom@18.3.1
(react@18.3.1)
)(react@18.3.1)
:
dependencies
:
dependencies
:
'
@jridgewell/sourcemap-codec'
:
1.4.15
'
@jridgewell/sourcemap-codec'
:
1.4.15
css-tree
:
1.1.3
css-tree
:
1.1.3
...
@@ -5570,8 +5587,9 @@ snapshots:
...
@@ -5570,8 +5587,9 @@ snapshots:
postcss-load-config@4.0.2(postcss@8.4.38)
:
postcss-load-config@4.0.2(postcss@8.4.38)
:
dependencies
:
dependencies
:
lilconfig
:
3.1.1
lilconfig
:
3.1.1
postcss
:
8.4.38
yaml
:
2.4.3
yaml
:
2.4.3
optionalDependencies
:
postcss
:
8.4.38
postcss-nested@6.0.1(postcss@8.4.38)
:
postcss-nested@6.0.1(postcss@8.4.38)
:
dependencies
:
dependencies
:
...
@@ -5633,7 +5651,7 @@ snapshots:
...
@@ -5633,7 +5651,7 @@ snapshots:
react
:
18.3.1
react
:
18.3.1
scheduler
:
0.23.2
scheduler
:
0.23.2
react-hot-toast@2.4.1(csstype@3.1.3)(react-dom@18.3.1)(react@18.3.1)
:
react-hot-toast@2.4.1(csstype@3.1.3)(react-dom@18.3.1
(react@18.3.1)
)(react@18.3.1)
:
dependencies
:
dependencies
:
goober
:
2.1.14(csstype@3.1.3)
goober
:
2.1.14(csstype@3.1.3)
react
:
18.3.1
react
:
18.3.1
...
@@ -5641,12 +5659,13 @@ snapshots:
...
@@ -5641,12 +5659,13 @@ snapshots:
transitivePeerDependencies
:
transitivePeerDependencies
:
-
csstype
-
csstype
react-i18next@14.1.2(i18next@23.11.5)(react-dom@18.3.1)(react@18.3.1)
:
react-i18next@14.1.2(i18next@23.11.5)(react-dom@18.3.1
(react@18.3.1)
)(react@18.3.1)
:
dependencies
:
dependencies
:
'
@babel/runtime'
:
7.24.6
'
@babel/runtime'
:
7.24.6
html-parse-stringify
:
3.0.1
html-parse-stringify
:
3.0.1
i18next
:
23.11.5
i18next
:
23.11.5
react
:
18.3.1
react
:
18.3.1
optionalDependencies
:
react-dom
:
18.3.1(react@18.3.1)
react-dom
:
18.3.1(react@18.3.1)
react-is@16.13.1
:
{}
react-is@16.13.1
:
{}
...
@@ -5655,15 +5674,16 @@ snapshots:
...
@@ -5655,15 +5674,16 @@ snapshots:
react-redux@9.1.2(@types/react@18.3.3)(react@18.3.1)(redux@5.0.1)
:
react-redux@9.1.2(@types/react@18.3.3)(react@18.3.1)(redux@5.0.1)
:
dependencies
:
dependencies
:
'
@types/react'
:
18.3.3
'
@types/use-sync-external-store'
:
0.0.3
'
@types/use-sync-external-store'
:
0.0.3
react
:
18.3.1
react
:
18.3.1
redux
:
5.0.1
use-sync-external-store
:
1.2.2(react@18.3.1)
use-sync-external-store
:
1.2.2(react@18.3.1)
optionalDependencies
:
'
@types/react'
:
18.3.3
redux
:
5.0.1
react-refresh@0.14.2
:
{}
react-refresh@0.14.2
:
{}
react-router-dom@6.23.1(react-dom@18.3.1)(react@18.3.1)
:
react-router-dom@6.23.1(react-dom@18.3.1
(react@18.3.1)
)(react@18.3.1)
:
dependencies
:
dependencies
:
'
@remix-run/router'
:
1.16.1
'
@remix-run/router'
:
1.16.1
react
:
18.3.1
react
:
18.3.1
...
@@ -5680,7 +5700,7 @@ snapshots:
...
@@ -5680,7 +5700,7 @@ snapshots:
react
:
18.3.1
react
:
18.3.1
tslib
:
2.6.2
tslib
:
2.6.2
react-use@17.5.0(react-dom@18.3.1)(react@18.3.1)
:
react-use@17.5.0(react-dom@18.3.1
(react@18.3.1)
)(react@18.3.1)
:
dependencies
:
dependencies
:
'
@types/js-cookie'
:
2.2.7
'
@types/js-cookie'
:
2.2.7
'
@xobotyi/scrollbar-width'
:
1.9.5
'
@xobotyi/scrollbar-width'
:
1.9.5
...
@@ -5688,7 +5708,7 @@ snapshots:
...
@@ -5688,7 +5708,7 @@ snapshots:
fast-deep-equal
:
3.1.3
fast-deep-equal
:
3.1.3
fast-shallow-equal
:
1.0.0
fast-shallow-equal
:
1.0.0
js-cookie
:
2.2.1
js-cookie
:
2.2.1
nano-css
:
5.6.1(react-dom@18.3.1)(react@18.3.1)
nano-css
:
5.6.1(react-dom@18.3.1
(react@18.3.1)
)(react@18.3.1)
react
:
18.3.1
react
:
18.3.1
react-dom
:
18.3.1(react@18.3.1)
react-dom
:
18.3.1(react@18.3.1)
react-universal-interface
:
0.6.2(react@18.3.1)(tslib@2.6.2)
react-universal-interface
:
0.6.2(react@18.3.1)(tslib@2.6.2)
...
@@ -6121,13 +6141,13 @@ snapshots:
...
@@ -6121,13 +6141,13 @@ snapshots:
vite@5.2.12(@types/node@20.14.0)(less@4.2.0)
:
vite@5.2.12(@types/node@20.14.0)(less@4.2.0)
:
dependencies
:
dependencies
:
'
@types/node'
:
20.14.0
esbuild
:
0.20.2
esbuild
:
0.20.2
less
:
4.2.0
postcss
:
8.4.38
postcss
:
8.4.38
rollup
:
4.18.0
rollup
:
4.18.0
optionalDependencies
:
optionalDependencies
:
'
@types/node'
:
20.14.0
fsevents
:
2.3.3
fsevents
:
2.3.3
less
:
4.2.0
void-elements@3.1.0
:
{}
void-elements@3.1.0
:
{}
...
@@ -6201,8 +6221,10 @@ snapshots:
...
@@ -6201,8 +6221,10 @@ snapshots:
yocto-queue@0.1.0
:
{}
yocto-queue@0.1.0
:
{}
zustand@4.5.2(@types/react@18.3.3)(react@18.3.1)
:
zustand@4.5.2(@types/react@18.3.3)(
immer@10.1.1)(
react@18.3.1)
:
dependencies
:
dependencies
:
use-sync-external-store
:
1.2.0(react@18.3.1)
optionalDependencies
:
'
@types/react'
:
18.3.3
'
@types/react'
:
18.3.3
immer
:
10.1.1
react
:
18.3.1
react
:
18.3.1
use-sync-external-store
:
1.2.0(react@18.3.1)
web/src/components/MemoContent/CodeBlock.tsx
View file @
e8ed437c
import
clsx
from
"clsx"
;
import
clsx
from
"clsx"
;
import
copy
from
"copy-to-clipboard"
;
import
copy
from
"copy-to-clipboard"
;
import
DOMPurify
from
"dompurify"
;
import
hljs
from
"highlight.js"
;
import
hljs
from
"highlight.js"
;
import
{
useCallback
,
useMemo
}
from
"react"
;
import
{
useCallback
,
useMemo
}
from
"react"
;
import
toast
from
"react-hot-toast"
;
import
toast
from
"react-hot-toast"
;
...
@@ -23,7 +24,8 @@ const CodeBlock: React.FC<Props> = ({ language, content }: Props) => {
...
@@ -23,7 +24,8 @@ const CodeBlock: React.FC<Props> = ({ language, content }: Props) => {
// Users can set Markdown code blocks as `__html` to render HTML directly.
// Users can set Markdown code blocks as `__html` to render HTML directly.
if
(
formatedLanguage
===
SpecialLanguage
.
HTML
)
{
if
(
formatedLanguage
===
SpecialLanguage
.
HTML
)
{
return
<
div
className=
"w-full overflow-auto !my-2"
dangerouslySetInnerHTML=
{
{
__html
:
content
}
}
/>;
const
purify
=
DOMPurify
(
window
);
return
<
div
className=
"w-full overflow-auto !my-2"
dangerouslySetInnerHTML=
{
{
__html
:
purify
.
sanitize
(
content
)
}
}
/>;
}
else
if
(
formatedLanguage
===
SpecialLanguage
.
MERMAID
)
{
}
else
if
(
formatedLanguage
===
SpecialLanguage
.
MERMAID
)
{
return
<
MermaidBlock
content=
{
content
}
/>;
return
<
MermaidBlock
content=
{
content
}
/>;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment