From 39a6a795e30b753c4a15f7babd73297d253a8956 Mon Sep 17 00:00:00 2001 From: Benjamin VIELLARD Date: Thu, 13 Apr 2023 00:12:09 +0200 Subject: [PATCH] fix: display empty doc as empty string --- src/tiptap-display.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tiptap-display.vue b/src/tiptap-display.vue index 9dc169d..75bd745 100644 --- a/src/tiptap-display.vue +++ b/src/tiptap-display.vue @@ -16,7 +16,7 @@ const props = withDefaults( ); function getText(json: JSONContent): string { - return json.text ?? json.content?.map(getText).join("").trim() + "\n"; + return json.text ?? (json.content?.map(getText).join("").trim() ?? "") + "\n"; } const text = computed(() => {