🎨chore: 使用 oxlint, oxfmt&格式化代码

This commit is contained in:
2026-02-08 21:16:25 +08:00
parent 9d35c6a9d8
commit 3a801ba016
78 changed files with 3367 additions and 1468 deletions

View File

@@ -1,7 +1,7 @@
<script setup lang="ts">
import md from 'markdown-it'
import hljs from "highlight.js";
import 'highlight.js/styles/github-dark-dimmed.min.css';
import hljs from 'highlight.js'
import 'highlight.js/styles/github-dark-dimmed.min.css'
const renderer = md({
html: true,
@@ -11,17 +11,16 @@ const renderer = md({
highlight: function (str, lang) {
if (lang && hljs.getLanguage(lang)) {
try {
return (
`<pre class="hljs" style="overflow-x: auto"><code>${
hljs.highlight(str, {language: lang, ignoreIllegals: true}).value
}</code></pre>`
)
} catch (_) {
}
return `<pre class="hljs" style="overflow-x: auto"><code>${
hljs.highlight(str, { language: lang, ignoreIllegals: true }).value
}</code></pre>`
} catch (_) {}
}
return '<pre class="hljs"><code>' + md().utils.escapeHtml(str) + '</code></pre>';
}
return (
'<pre class="hljs"><code>' + md().utils.escapeHtml(str) + '</code></pre>'
)
},
})
const props = defineProps({
@@ -34,11 +33,11 @@ const props = defineProps({
<template>
<article
class="prose dark:prose-invert max-w-none prose-sm prose-neutral"
v-html="renderer.render(source.replaceAll('\t', '&nbsp;&nbsp;&nbsp;&nbsp;'))"
class="prose dark:prose-invert max-w-none prose-sm prose-neutral"
v-html="
renderer.render(source.replaceAll('\t', '&nbsp;&nbsp;&nbsp;&nbsp;'))
"
></article>
</template>
<style scoped>
</style>
<style scoped></style>