fix: register plaintext hljs language and handle profile fetch error

- Register highlight.js plaintext language to fix "Unknown language" error
- Add try/catch around getMyProfile() to handle network errors gracefully
- Add components.d.ts to .gitignore (auto-generated by unplugin-vue-components)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
xuyueandClaude Sonnet 4.6 committed 2026-03-10 11:59:18 +08:00
1 parent a7aa4f63ac
commit 2bd9382c8c
3 files changed
+11 -4

No files matched your search

+2
View File
@@ -16,6 +16,7 @@ import hljs from "highlight.js/lib/core"
import xml from "highlight.js/lib/languages/xml"
import css from "highlight.js/lib/languages/css"
import javascript from "highlight.js/lib/languages/javascript"
import plaintext from "highlight.js/lib/languages/plaintext"
//@ts-ignore
import "highlight.js/styles/github.min.css"
import { router } from "./router"
@@ -24,6 +25,7 @@ hljs.registerLanguage("html", xml)
hljs.registerLanguage("css", css)
hljs.registerLanguage("js", javascript)
hljs.registerLanguage("javascript", javascript)
hljs.registerLanguage("plaintext", plaintext)
marked.use({
gfm: true,