feat(frontend): Shiki 白名单语言高亮并支持 aardio

显式加载常用语言;修复 pretty-code 去 shiki class 导致不上色,以及 aardio 循环别名。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-09-16 06:09:25 +08:00
parent 3f88b38610
commit 8d5e00a112
7 changed files with 290 additions and 23 deletions

View File

@@ -1891,17 +1891,34 @@ a.j13-mention-token:hover {
background: var(--accent-soft);
}
/* Shiki 双主题:跟随 html.dark;变量缺省时回退到正文色,避免整块「隐形」 */
/* Shiki 双主题:跟随 html.dark
注意:rehype-pretty-code 会去掉 pre 上的 .shiki class,
因此同时用 data-theme / 代码块容器命中,才能让 --shiki-* 变量真正上色 */
.prose-content .shiki,
.prose-content .shiki span {
.prose-content .shiki span,
.prose-content .md-code-block pre,
.prose-content .md-code-block pre span,
.prose-content .md-code-shiki-host .shiki,
.prose-content .md-code-shiki-host .shiki span,
.prose-content pre[data-theme],
.prose-content pre[data-theme] span {
color: var(--shiki-light, var(--ink));
background-color: transparent !important;
}
.prose-content .shiki {
.prose-content .shiki,
.prose-content .md-code-block pre,
.prose-content .md-code-shiki-host .shiki,
.prose-content pre[data-theme] {
background: transparent !important;
}
html.dark .prose-content .shiki,
html.dark .prose-content .shiki span {
html.dark .prose-content .shiki span,
html.dark .prose-content .md-code-block pre,
html.dark .prose-content .md-code-block pre span,
html.dark .prose-content .md-code-shiki-host .shiki,
html.dark .prose-content .md-code-shiki-host .shiki span,
html.dark .prose-content pre[data-theme],
html.dark .prose-content pre[data-theme] span {
color: var(--shiki-dark, var(--ink)) !important;
font-style: var(--shiki-dark-font-style) !important;
font-weight: var(--shiki-dark-font-weight) !important;