From e190a9eeb690ecf78c5381f335aeab24a6b2ffa2 Mon Sep 17 00:00:00 2001 From: Michel Roux Date: Thu, 8 Aug 2024 11:37:48 +0200 Subject: [PATCH] refactor: :recycle: use linkify and dompurify to show good descriptions --- package-lock.json | 10 +++++++++ package.json | 2 ++ src/components/Atoms/Modal.vue | 9 +++----- src/components/Atoms/SafeHtml.vue | 36 +++++++++++++++++++++++++++++++ src/components/Feed/Banner.vue | 11 +++------- src/utils/text.js | 7 ------ 6 files changed, 54 insertions(+), 21 deletions(-) create mode 100644 src/components/Atoms/SafeHtml.vue delete mode 100644 src/utils/text.js diff --git a/package-lock.json b/package-lock.json index 5eccc2a..beac5dd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,6 +13,8 @@ "@nextcloud/l10n": "^3.1.0", "@nextcloud/router": "^3.0.1", "@nextcloud/vue": "^8.16.0", + "dompurify": "^3.1.6", + "linkify-html": "^4.1.3", "vue": "^2", "vue-material-design-icons": "^5.3.0", "vue-router": "^3", @@ -7876,6 +7878,14 @@ "dev": true, "peer": true }, + "node_modules/linkify-html": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/linkify-html/-/linkify-html-4.1.3.tgz", + "integrity": "sha512-Ejb8X/pOxB4IVqG1U37tnF85UW3JtX+eHudH3zlZ2pODz2e/J7zQ/vj+VDWffwhTecJqdRehhluwrRmKoJz+iQ==", + "peerDependencies": { + "linkifyjs": "^4.0.0" + } + }, "node_modules/linkify-it": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-5.0.0.tgz", diff --git a/package.json b/package.json index ba06ae8..a7012f0 100644 --- a/package.json +++ b/package.json @@ -19,6 +19,8 @@ "@nextcloud/l10n": "^3.1.0", "@nextcloud/router": "^3.0.1", "@nextcloud/vue": "^8.16.0", + "dompurify": "^3.1.6", + "linkify-html": "^4.1.3", "vue": "^2", "vue-material-design-icons": "^5.3.0", "vue-router": "^3", diff --git a/src/components/Atoms/Modal.vue b/src/components/Atoms/Modal.vue index 57402ad..e24e240 100644 --- a/src/components/Atoms/Modal.vue +++ b/src/components/Atoms/Modal.vue @@ -1,9 +1,8 @@ -