Files
DiceCloud/app/imports/ui/components/MarkdownText.vue
Stefan Zermatten 8164b79667 Improved markdown formatting
Fixed pre-code breaking out of containers
2022-08-15 14:19:42 +02:00

27 lines
447 B
Vue

<template lang="html">
<!-- eslint-disable-next-line vue/no-v-html -->
<div
class="markdown"
v-html="compiledMarkdown"
/>
</template>
<script lang="js">
import { marked } from 'marked';
export default {
props: {
markdown: {
type: String,
default: undefined,
},
},
computed: {
compiledMarkdown() {
if (!this.markdown) return;
return marked(this.markdown);
},
},
}
</script>