feat(Markdown): enable github markdown alert (#8842)

This commit is contained in:
one 2025-08-05 14:56:15 +08:00 committed by GitHub
parent 63b126b530
commit cb2d7c060c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 15 additions and 0 deletions

View File

@ -243,6 +243,7 @@
"rehype-raw": "^7.0.0",
"remark-cjk-friendly": "^1.2.0",
"remark-gfm": "^4.0.1",
"remark-github-blockquote-alert": "^2.0.0",
"remark-math": "^6.0.0",
"remove-markdown": "^0.6.2",
"rollup-plugin-visualizer": "^5.12.0",

View File

@ -148,6 +148,7 @@
margin-top: 10px;
}
.markdown-alert,
blockquote {
margin: 1.5em 0;
padding: 1em 1.5em;

View File

@ -1,6 +1,7 @@
import 'katex/dist/katex.min.css'
import 'katex/dist/contrib/copy-tex'
import 'katex/dist/contrib/mhchem'
import 'remark-github-blockquote-alert/alert.css'
import ImageViewer from '@renderer/components/ImageViewer'
import MarkdownShadowDOMRenderer from '@renderer/components/MarkdownShadowDOMRenderer'
@ -22,6 +23,7 @@ import rehypeMathjax from 'rehype-mathjax'
import rehypeRaw from 'rehype-raw'
import remarkCjkFriendly from 'remark-cjk-friendly'
import remarkGfm from 'remark-gfm'
import remarkAlert from 'remark-github-blockquote-alert'
import remarkMath from 'remark-math'
import { Pluggable } from 'unified'
@ -90,6 +92,7 @@ const Markdown: FC<Props> = ({ block, postProcess }) => {
const remarkPlugins = useMemo(() => {
const plugins = [
[remarkGfm, { singleTilde: false }] as Pluggable,
[remarkAlert] as Pluggable,
remarkCjkFriendly,
remarkDisableConstructs(['codeIndented'])
]

View File

@ -7814,6 +7814,7 @@ __metadata:
rehype-raw: "npm:^7.0.0"
remark-cjk-friendly: "npm:^1.2.0"
remark-gfm: "npm:^4.0.1"
remark-github-blockquote-alert: "npm:^2.0.0"
remark-math: "npm:^6.0.0"
remove-markdown: "npm:^0.6.2"
rollup-plugin-visualizer: "npm:^5.12.0"
@ -18702,6 +18703,15 @@ __metadata:
languageName: node
linkType: hard
"remark-github-blockquote-alert@npm:^2.0.0":
version: 2.0.0
resolution: "remark-github-blockquote-alert@npm:2.0.0"
dependencies:
unist-util-visit: "npm:^5.0.0"
checksum: 10c0/7a84d5889b94ee2b7feba6b6d41d4b08025b38d752cfb8de2cd216ed61b768db7f706ef9d76eb484ce98b72b01a3005c0b2e08231d07d7cffe4538f91ca25dde
languageName: node
linkType: hard
"remark-math@npm:^4.0.0":
version: 4.0.0
resolution: "remark-math@npm:4.0.0"