diff --git a/components/publish/PublishWidget.vue b/components/publish/PublishWidget.vue index 00485874..1c9a937e 100644 --- a/components/publish/PublishWidget.vue +++ b/components/publish/PublishWidget.vue @@ -56,6 +56,7 @@ const { editor } = useTiptap({ onPaste: handlePaste, }) +const characterCount = $computed(() => htmlToText(editor.value?.getHTML() || '').length) let isUploading = $ref(false) let isExceedingAttachmentLimit = $ref(false) let failed = $ref([]) @@ -312,8 +313,8 @@ defineExpose({
-
- {{ editor?.storage.characterCount.characters() }}/{{ characterLimit }} +
+ {{ characterCount ?? 0 }}/{{ characterLimit }}
@@ -347,7 +348,7 @@ defineExpose({