rename our components - fixes #534
This commit is contained in:
parent
84e3eae77f
commit
7bafb3ab2e
6 changed files with 5 additions and 5 deletions
33
packages/frontend/src/components/SkFormula.vue
Normal file
33
packages/frontend/src/components/SkFormula.vue
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
<!--
|
||||
SPDX-FileCopyrightText: dakkar, MoshiBar, and other Sharkey contributors
|
||||
SPDX-License-Identifier: AGPL-3.0-only
|
||||
-->
|
||||
|
||||
<template>
|
||||
<div v-if="block" :class="$style.block" v-html="renderedFormula"></div>
|
||||
<span v-else v-html="renderedFormula"></span>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { computed } from 'vue';
|
||||
import katex from 'katex';
|
||||
import 'katex/dist/katex.min.css';
|
||||
|
||||
const props = defineProps<{
|
||||
formula: string;
|
||||
block: boolean;
|
||||
}>();
|
||||
|
||||
const renderedFormula = computed(() =>
|
||||
katex.renderToString(props.formula, {
|
||||
throwOnError: false,
|
||||
trust: false,
|
||||
displayMode: props.block,
|
||||
} as any));
|
||||
</script>
|
||||
|
||||
<style lang="scss" module>
|
||||
.block {
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
Loading…
Add table
Add a link
Reference in a new issue