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

Switch to v-safe-html in latex

parent ac898833
<script> <script>
import { GlSafeHtmlDirective as SafeHtml } from '@gitlab/ui';
import 'mathjax/es5/tex-svg'; import 'mathjax/es5/tex-svg';
import Prompt from '../prompt.vue'; import Prompt from '../prompt.vue';
...@@ -7,6 +8,9 @@ export default { ...@@ -7,6 +8,9 @@ export default {
components: { components: {
Prompt, Prompt,
}, },
directives: {
SafeHtml,
},
props: { props: {
count: { count: {
type: Number, type: Number,
...@@ -33,13 +37,16 @@ export default { ...@@ -33,13 +37,16 @@ export default {
return svg.outerHTML; return svg.outerHTML;
}, },
}, },
safeHtmlConfig: {
// to support SVGs and custom tags for mathjax
ADD_TAGS: ['use', 'mjx-container', 'mjx-tool', 'mjx-status', 'mjx-tip'],
},
}; };
</script> </script>
<template> <template>
<div class="output"> <div class="output">
<prompt type="Out" :count="count" :show-output="index === 0" /> <prompt type="Out" :count="count" :show-output="index === 0" />
<!-- eslint-disable --> <div ref="maths" v-safe-html:[$options.safeHtmlConfig]="code"></div>
<div ref="maths" v-html="code"></div>
</div> </div>
</template> </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