Skip to content

Commit faf0d85

Browse files
committed
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 <[email protected]>
1 parent 8d5e753 commit faf0d85

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/EditorFactory.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ const serializePlainText = (tiptap) => {
140140
const doc = tiptap.getJSON()
141141

142142
if (doc.content.length !== 1 || typeof doc.content[0].content === 'undefined' || doc.content[0].content.length !== 1) {
143-
if (doc.content[0].type === 'code_block' && typeof doc.content[0].content === 'undefined') {
143+
if (doc.content[0].type === 'codeBlock' && typeof doc.content[0].content === 'undefined') {
144144
return ''
145145
}
146146
throw new SerializeException('Failed to serialize document to plain text')

0 commit comments

Comments
 (0)