forked from mirrors/homebox
feat: markdown support (#165)
* initial markdown support via markdown-it * sanitize markup * remove pre-padding * fix linter errors
This commit is contained in:
parent
d2aa022347
commit
974d6914a2
8 changed files with 1396 additions and 1049 deletions
|
@ -17,6 +17,11 @@
|
|||
</a>
|
||||
</div>
|
||||
</template>
|
||||
<template v-else-if="detail.type === 'markdown'">
|
||||
<ClientOnly>
|
||||
<Markdown :source="detail.text" />
|
||||
</ClientOnly>
|
||||
</template>
|
||||
<template v-else>
|
||||
{{ detail.text }}
|
||||
</template>
|
||||
|
@ -28,11 +33,11 @@
|
|||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import type { CustomDetail, Detail } from "./types";
|
||||
import type { AnyDetail, Detail } from "./types";
|
||||
|
||||
defineProps({
|
||||
details: {
|
||||
type: Object as () => (Detail | CustomDetail)[],
|
||||
type: Object as () => (Detail | AnyDetail)[],
|
||||
required: true,
|
||||
},
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue