fix(frontend): 修复 Markdown 目录锚点跳转与 Tauri 路由

- 安装 rehype-slug 插件,自动为 heading 生成 id,解决目录链接无锚点目标的问题
- 自定义 <a> 组件处理内部锚点链接,阻止默认刷新行为并使用 scrollIntoView 平滑滚动
- Tauri 桌面端改用 HashRouter,避免刷新时 404 及错误打开外部浏览器

fixes #xxx

Co-Authored-By: HAPI <noreply@hapi.run>
This commit is contained in:
techotaku39
2026-05-24 02:53:08 +08:00
parent 717df2af7b
commit ebdb254fc6
4 changed files with 98 additions and 77 deletions

View File

@@ -57,6 +57,7 @@
"react-router-dom": "^7.5.1",
"react-syntax-highlighter": "^15.6.1",
"rehype-katex": "^6.0.2",
"rehype-slug": "^6.0.0",
"remark-gfm": "3.0.1",
"remark-math": "^5.1.1",
"sonner": "^2.0.3",