first commit

This commit is contained in:
Rafi
2023-02-11 17:37:20 +08:00
commit 0c4f782a1b
22 changed files with 5949 additions and 0 deletions

25
components/MsgContent.vue Normal file
View File

@@ -0,0 +1,25 @@
<script setup>
import { marked } from "marked"
import hljs from "highlight.js"
marked.setOptions({
highlight: function (code, lang) {
const language = hljs.getLanguage(lang) ? lang : 'plaintext'
return hljs.highlight(code, { language }).value
},
langPrefix: 'hljs language-', // highlight.js css class prefix
})
const props = defineProps(['content'])
const contentHtml = computed(() => {
return props.content ? marked(props.content) : ''
})
</script>
<template>
<div
v-html="contentHtml"
></div>
</template>