Added markdown support to features
This commit is contained in:
20
app/imports/ui/components/MarkdownText.vue
Normal file
20
app/imports/ui/components/MarkdownText.vue
Normal file
@@ -0,0 +1,20 @@
|
||||
<template lang="html">
|
||||
<div v-html="compiledMarkdown">
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import marked from 'marked';
|
||||
|
||||
export default {
|
||||
props: {
|
||||
markdown: String,
|
||||
},
|
||||
computed: {
|
||||
compiledMarkdown() {
|
||||
if (!this.markdown) return;
|
||||
return marked(this.markdown, { sanitize: true });
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
Reference in New Issue
Block a user