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 { Detail, CustomDetail } from "~~/components/global/DetailsSection/types";
import { AnyDetail, Details } from "~~/components/global/DetailsSection/types";
import { LocationSummary, LocationUpdate } from "~~/lib/api/types/data-contracts";
import { useLocationStore } from "~~/stores/locations";
@ -30,16 +30,17 @@
return data;
});
const details = computed<(Detail | CustomDetail)[]>(() => {
const details = computed<Details>(() => {
const details = [
{
name: "Name",
text: location.value?.name,
text: location.value?.name ?? "",
},
{
name: "Description",
text: location.value?.description,
},
type: "markdown",
text: location.value?.description ?? "",
} as AnyDetail,
];
if (preferences.value.showDetails) {