From 974d6914a2ca3990507d2e58e6425fedee0dd129 Mon Sep 17 00:00:00 2001
From: Hayden <64056131+hay-kot@users.noreply.github.com>
Date: Fri, 2 Dec 2022 16:12:32 -0900
Subject: [PATCH] feat: markdown support (#165)
* initial markdown support via markdown-it
* sanitize markup
* remove pre-padding
* fix linter errors
---
.../global/DetailsSection/DetailsSection.vue | 9 +-
.../components/global/DetailsSection/types.ts | 9 +-
frontend/components/global/Markdown.vue | 80 +
frontend/package.json | 2 +
frontend/pages/item/[id]/index.vue | 7 +-
frontend/pages/label/[id].vue | 7 +-
frontend/pages/location/[id].vue | 11 +-
frontend/pnpm-lock.yaml | 2320 +++++++++--------
8 files changed, 1396 insertions(+), 1049 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..40b6cd1 100644
--- a/frontend/components/global/DetailsSection/DetailsSection.vue
+++ b/frontend/components/global/DetailsSection/DetailsSection.vue
@@ -17,6 +17,11 @@
+
+
+
+
+
{{ detail.text }}
@@ -28,11 +33,11 @@
+
+
+
+
+
+
diff --git a/frontend/package.json b/frontend/package.json
index 5c6eb39..a06db47 100644
--- a/frontend/package.json
+++ b/frontend/package.json
@@ -37,6 +37,8 @@
"@vueuse/nuxt": "^9.1.1",
"autoprefixer": "^10.4.8",
"daisyui": "^2.24.0",
+ "dompurify": "^2.4.1",
+ "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 @@