Support math rendering on MFM (#3260)

This commit is contained in:
Aya Morisawa
2018-11-16 17:03:52 +09:00
committed by syuilo
parent d2385a0e52
commit ad84901f39
7 changed files with 75 additions and 0 deletions

View File

@ -0,0 +1,26 @@
<template>
<span v-html="compiledFormula"></span>
</template>
<script lang="ts">
import Vue from 'vue';
import * as katex from 'katex';
export default Vue.extend({
props: {
formula: {
type: String,
required: true
}
},
computed: {
compiledFormula(): any {
return katex.renderToString(this.formula);
}
}
});
</script>
<style>
@import "../../../../../../node_modules/katex/dist/katex.min.css";
</style>