From 228e55a17ccf1da86bf703b65f2a7dcb9d404962 Mon Sep 17 00:00:00 2001
From: Hayden <64056131+hay-kot@users.noreply.github.com>
Date: Fri, 2 Dec 2022 15:50:14 -0900
Subject: [PATCH] initial markdown support via markdown-it
---
.../global/DetailsSection/DetailsSection.vue | 5 +
.../components/global/DetailsSection/types.ts | 9 +-
frontend/components/global/Markdown.vue | 75 +
frontend/package.json | 1 +
frontend/pages/item/[id]/index.vue | 7 +-
frontend/pages/label/[id].vue | 7 +-
frontend/pages/location/[id].vue | 11 +-
frontend/pnpm-lock.yaml | 2314 +++++++++--------
8 files changed, 1382 insertions(+), 1047 deletions(-)
create mode 100644 frontend/components/global/Markdown.vue
diff --git a/frontend/components/global/DetailsSection/DetailsSection.vue b/frontend/components/global/DetailsSection/DetailsSection.vue
index fc6b240..d1a135f 100644
--- a/frontend/components/global/DetailsSection/DetailsSection.vue
+++ b/frontend/components/global/DetailsSection/DetailsSection.vue
@@ -17,6 +17,11 @@
+
+
+
+
+
{{ detail.text }}
diff --git a/frontend/components/global/DetailsSection/types.ts b/frontend/components/global/DetailsSection/types.ts
index a7e05d5..3c5cffe 100644
--- a/frontend/components/global/DetailsSection/types.ts
+++ b/frontend/components/global/DetailsSection/types.ts
@@ -21,11 +21,16 @@ type LinkDetail = BaseDetail & {
href: string;
};
-export type CustomDetail = DateDetail | CurrencyDetail | LinkDetail;
+type MarkdownDetail = BaseDetail & {
+ type: "markdown",
+ text: string;
+};
export type Detail = BaseDetail & {
text: StringLike;
type?: "text";
};
-export type Details = Array;
+export type AnyDetail = DateDetail | CurrencyDetail | LinkDetail | MarkdownDetail | Detail;
+
+export type Details = Array;
diff --git a/frontend/components/global/Markdown.vue b/frontend/components/global/Markdown.vue
new file mode 100644
index 0000000..1a08baf
--- /dev/null
+++ b/frontend/components/global/Markdown.vue
@@ -0,0 +1,75 @@
+
+
+
+
+
+
+
diff --git a/frontend/package.json b/frontend/package.json
index 5c6eb39..b7b0516 100644
--- a/frontend/package.json
+++ b/frontend/package.json
@@ -37,6 +37,7 @@
"@vueuse/nuxt": "^9.1.1",
"autoprefixer": "^10.4.8",
"daisyui": "^2.24.0",
+ "markdown-it": "^13.0.1",
"pinia": "^2.0.21",
"postcss": "^8.4.16",
"tailwindcss": "^3.1.8",
diff --git a/frontend/pages/item/[id]/index.vue b/frontend/pages/item/[id]/index.vue
index cf67854..e3d6afb 100644
--- a/frontend/pages/item/[id]/index.vue
+++ b/frontend/pages/item/[id]/index.vue
@@ -1,5 +1,5 @@