Add multiline math syntax

Co-authored-by: syuilo <syuilotan@yahoo.co.jp>
This commit is contained in:
Aya Morisawa
2019-01-25 23:08:06 +09:00
parent 4398651841
commit 79d2374d8e
6 changed files with 62 additions and 17 deletions

View File

@ -1,5 +1,6 @@
<template>
<span v-html="compiledFormula"></span>
<div v-if="block" v-html="compiledFormula"></div>
<span v-else v-html="compiledFormula"></span>
</template>
<script lang="ts">
@ -11,6 +12,10 @@ export default Vue.extend({
formula: {
type: String,
required: true
},
block: {
type: Boolean,
required: true
}
},
computed: {

View File

@ -1,5 +1,5 @@
<template>
<x-formula :formula="formula"/>
<x-formula :formula="formula" :block="block" />
</template>
<script lang="ts">
@ -14,6 +14,10 @@ export default Vue.extend({
formula: {
type: String,
required: true
},
block: {
type: Boolean,
required: true
}
}
});

View File

@ -228,12 +228,24 @@ export default Vue.component('misskey-flavored-markdown', {
})];
}
case 'math': {
case 'mathInline': {
//const MkFormula = () => import('./formula.vue').then(m => m.default);
return [createElement(MkFormula, {
key: Math.random(),
props: {
formula: token.node.props.formula
formula: token.node.props.formula,
block: false
}
})];
}
case 'mathBlock': {
//const MkFormula = () => import('./formula.vue').then(m => m.default);
return [createElement(MkFormula, {
key: Math.random(),
props: {
formula: token.node.props.formula,
block: true
}
})];
}