From 20632e8dfe978d6431f7da073e6a6f28b3496923 Mon Sep 17 00:00:00 2001 From: Yaacov Date: Fri, 9 Aug 2024 11:15:15 +0200 Subject: [PATCH] Fix markdown content recovery --- confiture-web-app/src/components/ui/Tiptap.vue | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/confiture-web-app/src/components/ui/Tiptap.vue b/confiture-web-app/src/components/ui/Tiptap.vue index a9c08a6c..ca5909c4 100644 --- a/confiture-web-app/src/components/ui/Tiptap.vue +++ b/confiture-web-app/src/components/ui/Tiptap.vue @@ -30,16 +30,14 @@ lowlight.register("ts", ts); const props = defineProps(["content"]); const emit = defineEmits(["update:content"]); -//JSON.stringify(document.querySelector(".tiptap").editor.getJSON()) function getContent() { - let jsonContent; + let jsonContent = props.content; try { jsonContent = JSON.parse(props.content); - } catch (e) { - return ""; + } finally { + return jsonContent; } - return jsonContent; } const editor = useEditor({