fix: reverted back document info changes

This commit is contained in:
Palanikannan M
2024-09-13 14:24:55 +05:30
parent c0fb56c71b
commit 2502d5144d

View File

@@ -241,10 +241,12 @@ export const useEditor = (props: CustomEditorProps) => {
editorRef.current.chain().focus().deleteRange({ from, to }).insertContent(contentHTML).run();
}
},
documentInfo: {
characters: editorRef.current?.storage?.characterCount?.characters?.() ?? 0,
paragraphs: getParagraphCount(editorRef.current?.state),
words: editorRef.current?.storage?.characterCount?.words?.() ?? 0,
getDocumentInfo: () => {
return {
characters: editorRef?.current?.storage?.characterCount?.characters?.() ?? 0,
paragraphs: getParagraphCount(editorRef?.current?.state),
words: editorRef?.current?.storage?.characterCount?.words?.() ?? 0,
};
},
}),
[editorRef, savedSelection]