First commit
This commit is contained in:
14
frontend/app/components/KatexSpan.vue
Normal file
14
frontend/app/components/KatexSpan.vue
Normal file
@@ -0,0 +1,14 @@
|
||||
<script setup lang="ts">
|
||||
/** Renders a short inline LaTeX snippet with KaTeX. */
|
||||
import katex from 'katex'
|
||||
|
||||
const props = defineProps<{ tex: string }>()
|
||||
|
||||
const html = computed(() =>
|
||||
katex.renderToString(props.tex, { throwOnError: false, displayMode: false })
|
||||
)
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<span v-html="html" />
|
||||
</template>
|
||||
Reference in New Issue
Block a user