evcc-io/assets/js/components/Config/Markdown.vue
2025-05-29 15:57:01 +02:00

30 lines
471 B
Vue

<template>
<!-- eslint-disable-next-line vue/no-v-html -->
<div class="root" v-html="compiledMarkdown"></div>
</template>
<script>
import snarkdown from "snarkdown";
export default {
name: "MarkdownRenderer",
props: {
markdown: String,
},
computed: {
compiledMarkdown() {
return snarkdown(this.markdown);
},
},
};
</script>
<style scoped>
.root {
max-width: 100%;
}
.root :deep(pre.code) {
overflow-x: auto;
margin: 1em 0;
hyphens: none;
}
</style>