markdown support
This commit is contained in:
21
nginx/vue/src/components/quick/Markdown.vue
Normal file
21
nginx/vue/src/components/quick/Markdown.vue
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
<script setup>
|
||||||
|
import MarkdownIt from "markdown-it";
|
||||||
|
import { katex } from "@mdit/plugin-katex";
|
||||||
|
|
||||||
|
const mdIt = MarkdownIt().use(katex);
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
source: String,
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div
|
||||||
|
v-html="mdIt.render(props.source)"
|
||||||
|
class="flex-col center-content"
|
||||||
|
></div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
@import "katex/dist/katex.min.css";
|
||||||
|
</style>
|
||||||
Reference in New Issue
Block a user