Commit 1ac8a9d1 authored by Kushal Pandya's avatar Kushal Pandya

Merge branch 'fhmurakami-v-safe-html-latex' into 'master'

Switch to v-safe-html in latex

See merge request gitlab-org/gitlab!72733
parents 6665b71e 45bbf84f
<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