feat: markdown support (#165)

* initial markdown support via markdown-it

* sanitize markup

* remove pre-padding

* fix linter errors
This commit is contained in:
Hayden 2022-12-02 16:12:32 -09:00 committed by GitHub
parent d2aa022347
commit 974d6914a2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 1396 additions and 1049 deletions

View file

@ -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,
},
});