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

@ -1,5 +1,5 @@
<script setup lang="ts">
import type { CustomDetail, Detail } from "~~/components/global/DetailsSection/types";
import type { AnyDetail, Details } from "~~/components/global/DetailsSection/types";
definePageMeta({
middleware: ["auth"],
@ -23,7 +23,7 @@
return data;
});
const details = computed<(Detail | CustomDetail)[]>(() => {
const details = computed<Details>(() => {
const details = [
{
name: "Name",
@ -31,8 +31,9 @@
},
{
name: "Description",
type: "markdown",
text: label.value?.description,
},
} as AnyDetail,
];
if (preferences.value.showDetails) {