Commit 45bbf84f authored by Felipe Murakami's avatar Felipe Murakami Committed by Kushal Pandya

Switch to v-safe-html in latex

parent ac898833
<script>
import { GlSafeHtmlDirective as SafeHtml } from '@gitlab/ui';
import 'mathjax/es5/tex-svg';
import Prompt from '../prompt.vue';
......@@ -7,6 +8,9 @@ export default {
components: {
Prompt,
},
directives: {
SafeHtml,
},
props: {
count: {
type: Number,
......@@ -33,13 +37,16 @@ export default {
return svg.outerHTML;
},
},
safeHtmlConfig: {
// to support SVGs and custom tags for mathjax
ADD_TAGS: ['use', 'mjx-container', 'mjx-tool', 'mjx-status', 'mjx-tip'],
},
};
</script>
<template>
<div class="output">
<prompt type="Out" :count="count" :show-output="index === 0" />
<!-- eslint-disable -->
<div ref="maths" v-html="code"></div>
<div ref="maths" v-safe-html:[$options.safeHtmlConfig]="code"></div>
</div>
</template>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment