ueberdosis/tiptap

Character count extension trims text from the beginning instead of the end when content exceeds limit

开放

#7,254 创建于 2025年11月20日

 (2 条评论) (1 个反应) (0 位负责人)TypeScript (1,979 个派生)batch import
area: editorcomplexity: easygood first issueimpact: mediumstatus: triagetype: help-wanted

仓库指标

星标
 (23,454 个星标)
PR 合并指标
 (平均合并 4天 13小时) (30 天内合并 46 个 PR)

描述

Affected Packages

character-count

Version(s)

Bug Description

When adding the character count extension to an existing project where the editor content already exceeds the maximum allowed length, the plugin cuts the text as expected. However, the text is cut from left to right (beginning to end), so the starting text disappears instead of trimming from the end as expected.

Browser Used

Chrome

Code Example URL

https://codesandbox.io/p/devbox/twilight-leaf-kfmcqv

Expected Behavior

Current: …cutoff you could build one of the biggest social networks on that idea.

Expected: Let‘s make sure people can’t write more than 100 characters. I bet you could build one …cutoff

Additional Context (Optional)

I think the issue needs to be fixed inside this if condition: https://github.com/ueberdosis/tiptap/blob/e4b95fab00f9ac9f286e82bb0d179043c1f135e7/packages/extensions/src/character-count/character-count.ts#L121

Dependency Updates

  • Yes, I've updated all my dependencies.

贡献者指南