feat(frontend): 添加 GitHub 代码块主题设置

This commit is contained in:
2026-08-30 20:41:42 +08:00
parent 7803ae5110
commit 3595021d80
9 changed files with 143 additions and 13 deletions
+13
View File
@@ -0,0 +1,13 @@
import { describe, expect, it } from 'vitest'
import { highlightCode } from './markdown'
describe('Shiki GitHub 双主题', () => {
it('一次渲染同时生成 GitHub Light 和 GitHub Dark 颜色变量', async () => {
const html = await highlightCode('const answer = 42', 'typescript')
expect(html).toContain('github-light')
expect(html).toContain('github-dark')
expect(html).toContain('--shiki-light')
expect(html).toContain('--shiki-dark')
})
})