From 05f53ccfcebb4d98ac7bfc43bff5064d6892aa7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20LeBlanc?= Date: Fri, 5 Nov 2021 18:51:40 -0400 Subject: [PATCH 1/6] [FIX] Allow HTML in Toast content --- src/components/VtToast.vue | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/components/VtToast.vue b/src/components/VtToast.vue index b69985e..d0820b7 100644 --- a/src/components/VtToast.vue +++ b/src/components/VtToast.vue @@ -7,11 +7,10 @@ @mouseleave="hoverPlay" > -
- +
+
Date: Fri, 6 May 2022 13:44:35 -0400 Subject: [PATCH 2/6] [FEATURE] allowUnsafeHtml props --- src/components/VtToast.vue | 3 ++- src/ts/propValidators.ts | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/VtToast.vue b/src/components/VtToast.vue index d0820b7..2e66805 100644 --- a/src/components/VtToast.vue +++ b/src/components/VtToast.vue @@ -7,7 +7,8 @@ @mouseleave="hoverPlay" > -
+
+
>, default: () => ({ From be3151464bfccfcd15cca434b2fec168188bb212 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20LeBlanc?= Date: Fri, 6 May 2022 15:07:59 -0400 Subject: [PATCH 3/6] [FIX] Incorrect type for allowUnsafeHtml and make it facultative --- src/components/VtToast.vue | 2 +- src/types/toast.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/VtToast.vue b/src/components/VtToast.vue index 52d5a1f..a7645b0 100644 --- a/src/components/VtToast.vue +++ b/src/components/VtToast.vue @@ -58,7 +58,7 @@ import ProgressBar from "./VtProgressBar.vue" interface ToastProps { content: ToastOptionsAndContent["content"] - allowUnsafeHtml: ToastOptionsAndContent["allowUnsafeHtml"] + allowUnsafeHtml?: ToastOptionsAndContent["allowUnsafeHtml"] id?: ToastOptionsAndContent["id"] accessibility?: ToastOptionsAndContent["accessibility"] bodyClassName?: ToastOptionsAndContent["bodyClassName"] diff --git a/src/types/toast.ts b/src/types/toast.ts index 60e2cf5..499caac 100644 --- a/src/types/toast.ts +++ b/src/types/toast.ts @@ -97,7 +97,7 @@ export declare interface ToastOptions extends BaseToastOptions { /** * If unsafe HTML is allowed as content. */ - allowUnsafeHtml?: false + allowUnsafeHtml?: boolean /** * Type of the toast. * From 0978a4edcbfb8b9fe48bf83da14f7942d1f3fe41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20LeBlanc?= Date: Fri, 6 May 2022 15:11:30 -0400 Subject: [PATCH 4/6] [FIX] Update snapshots after using v-text instead interpolation --- .../__snapshots__/VtToast.spec.ts.snap | 18 ------------------ .../VtToastContainer.spec.ts.snap | 6 ------ 2 files changed, 24 deletions(-) diff --git a/tests/unit/components/__snapshots__/VtToast.spec.ts.snap b/tests/unit/components/__snapshots__/VtToast.spec.ts.snap index c7e525a..10c3fe6 100644 --- a/tests/unit/components/__snapshots__/VtToast.spec.ts.snap +++ b/tests/unit/components/__snapshots__/VtToast.spec.ts.snap @@ -21,9 +21,7 @@ exports[`VtToast snapshots renders 1`] = ` class="Vue-Toastification__toast-body" role="alert" > - content -