diff options
author | Ferdinand Thiessen <rpm@fthiessen.de> | 2022-07-19 16:45:48 +0300 |
---|---|---|
committer | Ferdinand Thiessen <rpm@fthiessen.de> | 2022-07-19 16:51:53 +0300 |
commit | f9b28a9f0b0b4ddb10c876dfe991f79c00839638 (patch) | |
tree | fb97d607ffe7e5144d47f2db974035471ba4c19b | |
parent | d8abe1d5f995902fe5815d11e10295b51404cb86 (diff) |
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 <rpm@fthiessen.de>
-rw-r--r-- | src/EditorFactory.js | 2 |
1 files changed, 1 insertions, 1 deletions
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') |