fix: respect the length seen (#1310)
This commit is contained in:
parent
09997c2f90
commit
c3b9f8fc2a
3 changed files with 18 additions and 3 deletions
|
@ -1,5 +1,6 @@
|
|||
<script setup lang="ts">
|
||||
import { EditorContent } from '@tiptap/vue-3'
|
||||
import stringLength from 'string-length'
|
||||
import type { mastodon } from 'masto'
|
||||
import type { Draft } from '~/types'
|
||||
|
||||
|
@ -62,7 +63,7 @@ const { editor } = useTiptap({
|
|||
onPaste: handlePaste,
|
||||
})
|
||||
const characterCount = $computed(() => {
|
||||
let length = htmlToText(editor.value?.getHTML() || '').length
|
||||
let length = stringLength(htmlToText(editor.value?.getHTML() || ''))
|
||||
|
||||
if (draft.mentions) {
|
||||
// + 1 is needed as mentions always need a space seperator at the end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue