Skip to content

Commit

Permalink
fix: calculate the number of words across linebreaks correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
Philipp Kühn authored and Philipp Kühn committed Dec 9, 2021
1 parent b318d46 commit 0879a2f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/extension-character-count/src/character-count.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export const CharacterCount = Extension.create<CharacterCountOptions, CharacterC

this.storage.words = options => {
const node = options?.node || this.editor.state.doc
const text = node.textBetween(0, node.content.size, undefined, ' ')
const text = node.textBetween(0, node.content.size, ' ', ' ')
const words = text
.split(' ')
.filter(word => word !== '')
Expand Down

0 comments on commit 0879a2f

Please sign in to comment.