diff --git a/CHANGELOG.md b/CHANGELOG.md index ce3b887d0..6ef04d10d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ All notable changes to this project will be documented in this file. The format - Organization, department and product details are now edited from within the current item's about page. +- Made links clickable in the description of objects, key results and goals. ## [3.9.0] 2023-09-01 diff --git a/src/components/HTMLOutput.vue b/src/components/HTMLOutput.vue index 0c3bdf07d..ee94f023b 100644 --- a/src/components/HTMLOutput.vue +++ b/src/components/HTMLOutput.vue @@ -25,6 +25,12 @@ export default { deep: true, immediate: true, async handler(html) { + dompurify.addHook('afterSanitizeAttributes', function (node) { + // set all elements owning target to target=_blank + if ('target' in node) { + node.setAttribute('target', '_blank'); + } + }); this.sanitizedHtml = await dompurify.sanitize(marked(html)); }, }, diff --git a/src/components/KpiDetails.vue b/src/components/KpiDetails.vue index 46e74f270..ee6e4be6d 100644 --- a/src/components/KpiDetails.vue +++ b/src/components/KpiDetails.vue @@ -13,7 +13,11 @@ {{ $t('kpi.newValue') }} -

{{ kpi.description }}

+ @@ -55,6 +59,7 @@ export default { components: { PktButton, ProgressModal: () => import('@/components/modals/KPIProgressModal.vue'), + HTMLOutput: () => import('@/components/HTMLOutput.vue'), WidgetKpiProgressGraph, WidgetKpiProgressHistory, WidgetKpiProgressStats, diff --git a/src/views/KeyResultHome.vue b/src/views/KeyResultHome.vue index dbb3f7996..7c7c1a77e 100644 --- a/src/views/KeyResultHome.vue +++ b/src/views/KeyResultHome.vue @@ -16,9 +16,10 @@ /> -

- {{ activeKeyResult.description }} -

+ import('@/components/drawers/EditKeyResult.vue'), ArchivedRestore: () => import('@/components/ArchivedRestore.vue'), + HTMLOutput: () => import('@/components/HTMLOutput.vue'), }, beforeRouteUpdate: routerGuard, diff --git a/src/views/ObjectiveHome.vue b/src/views/ObjectiveHome.vue index 04599b30e..bf47ebd79 100644 --- a/src/views/ObjectiveHome.vue +++ b/src/views/ObjectiveHome.vue @@ -20,9 +20,10 @@
-

- {{ activeObjective.description }} -

+
import('@/components/drawers/EditObjective.vue'), KeyResultDrawer: () => import('@/components/drawers/EditKeyResult.vue'), ArchivedRestore: () => import('@/components/ArchivedRestore.vue'),