Markdown now works in property descriptions for viewers

This commit is contained in:
Stefan Zermatten
2020-03-13 10:12:01 +02:00
parent 27300190d3
commit adfe1dc613
2 changed files with 8 additions and 1 deletions

View File

@@ -13,6 +13,8 @@
computed: {
compiledMarkdown() {
if (!this.markdown) return;
//TODO sanitizing by marked is deprecated
//TODO Markdown <hr> need to be styled to match their vue components
return marked(this.markdown, { sanitize: true });
},
},

View File

@@ -1,13 +1,18 @@
<template lang="html">
<p v-if="value" class="mt-3">
{{value}}
<markdown-text :markdown="value"/>
</p>
</template>
<script>
import MarkdownText from '/imports/ui/components/MarkdownText.vue';
export default {
props: {
value: String,
},
components: {
MarkdownText,
},
}
</script>