Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

纯文本字数统计 #297

Closed
stevapple opened this issue Apr 10, 2020 · 0 comments
Closed

纯文本字数统计 #297

stevapple opened this issue Apr 10, 2020 · 0 comments
Assignees
Milestone

Comments

@stevapple
Copy link
Contributor

stevapple commented Apr 10, 2020

你在什么场景下需要该功能?

写作过程中了解写作的准确字数,而非 Markdown 字符串长度。

描述可能的解决方案

  • Lute 中支持获取纯文本;
  • Counter 中支持字词统计与非空白字符统计;
  • Option 中开辟更丰富的 counter 设置项。

描述你认为的候选方案

通过遍历 Lute 生成的 DOM 树以在 Vditor 中直接支持纯文本(因为性能问题,不推荐)。

其他信息

为了区分字数统计方案,需要在 Counter.render 中添加 type 参数来控制,已在 #298 实现。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants