Skip to content
Permalink
Browse files

Sanitize markdown before rendering preview

  • Loading branch information...
rijkvanzanten committed Jun 27, 2019
1 parent 7e8246d commit f010b49eef1526fe0882078bb4a07688e8cc92c1
Showing with 5 additions and 5 deletions.
  1. +5 −5 src/interfaces/markdown/input.vue
@@ -17,20 +17,18 @@
></div>
<div v-if="options.tabbed" class="toolbar">
<span :class="{ active: !preview }" @click="preview = false">
<v-icon name="code" size="22" />
<v-icon name="code" size="24" />
{{ $t("interfaces-markdown-edit") }}
</span>
<span :class="{ active: preview }" @click="preview = true">
<v-icon name="visibility" size="22" />
<v-icon name="visibility" size="24" />
{{ $t("interfaces-markdown-preview") }}
</span>
</div>
</div>
</template>

<script>
// v-show="editor"
// v-show="!editor"
import marked from "marked";
import mixin from "@directus/extension-toolkit/mixins/interface";
@@ -44,7 +42,9 @@ export default {
computed: {
compiledMarkdown() {
if (this.value) {
return marked(this.value);
return marked(this.value, {
sanitize: true
});
}
return this.value;
}

0 comments on commit f010b49

Please sign in to comment.
You can’t perform that action at this time.