feat(markdown): Migrate to comark for markdown rendering
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
<script setup lang="ts">
|
||||
import { renderMath } from 'comark/plugins/math';
|
||||
|
||||
const props = defineProps<{
|
||||
content: string;
|
||||
display: boolean;
|
||||
}>();
|
||||
|
||||
const html = computed(() => renderMath(props.content, props.display, { throwOnError: false }));
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<span v-if="!display" class="math-inline" v-html="html"></span>
|
||||
<div v-else class="math-block" v-html="html"></div>
|
||||
</template>
|
||||
Reference in New Issue
Block a user