From f9b28a9f0b0b4ddb10c876dfe991f79c00839638 Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Tue, 19 Jul 2022 15:45:48 +0200 Subject: Fixed typo in EditorFactory `serializePlainText` An empty text file should be serialized as `''` so fix checking if the document only contains an empty code block which type is `codeBlock` on tiptap v2 not `code_block`. Signed-off-by: Ferdinand Thiessen --- src/EditorFactory.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/EditorFactory.js b/src/EditorFactory.js index 54424c78d..dd5979277 100644 --- a/src/EditorFactory.js +++ b/src/EditorFactory.js @@ -140,7 +140,7 @@ const serializePlainText = (tiptap) => { const doc = tiptap.getJSON() if (doc.content.length !== 1 || typeof doc.content[0].content === 'undefined' || doc.content[0].content.length !== 1) { - if (doc.content[0].type === 'code_block' && typeof doc.content[0].content === 'undefined') { + if (doc.content[0].type === 'codeBlock' && typeof doc.content[0].content === 'undefined') { return '' } throw new SerializeException('Failed to serialize document to plain text') -- cgit v1.2.3