From 4612bb1de367fa8bfc43936e80a0f92bb7df55bc Mon Sep 17 00:00:00 2001
From: Simon Van Accoleyen <simon@vanacco.fr>
Date: Wed, 1 Nov 2023 13:26:35 +0100
Subject: [PATCH] fix: render markdown in notes on the dashboard (#6576)

Co-authored-by: Alexis Saettler <alexis@saettler.org>
---
 resources/js/components/dashboard/DashboardLog.vue | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/resources/js/components/dashboard/DashboardLog.vue b/resources/js/components/dashboard/DashboardLog.vue
index b11df919525..6ce17db1496 100644
--- a/resources/js/components/dashboard/DashboardLog.vue
+++ b/resources/js/components/dashboard/DashboardLog.vue
@@ -99,9 +99,7 @@
               <a :href="'people/' + note.contact.id">
                 {{ note.name }}
               </a>
-              <p>
-                {{ note.body }}
-              </p>
+              <p v-html="compiledMarkdown(note.body)"></p>
             </div>
           </div>
         </template>
@@ -449,7 +447,11 @@ export default {
         .then(response => {
           this.tasks.splice(this.tasks.indexOf(task), 1);
         });
-    }
+    },
+
+    compiledMarkdown (text) {
+      return text !== undefined && text !== null ? marked(text, { sanitize: true }) : '';
+    },
   }
 };
 </script>