From 0babb8b451ce3477df71450f28e58fcdac08c94a Mon Sep 17 00:00:00 2001 From: Yifan Song <41675306+Eric-Song-Nop@users.noreply.github.com> Date: Tue, 12 Nov 2024 07:11:16 +0100 Subject: [PATCH] fix: wrong word count when empty line exists (#795) --- crates/tinymist/src/tool/word_count.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/crates/tinymist/src/tool/word_count.rs b/crates/tinymist/src/tool/word_count.rs index ff7fd26c..638a30a5 100644 --- a/crates/tinymist/src/tool/word_count.rs +++ b/crates/tinymist/src/tool/word_count.rs @@ -133,9 +133,8 @@ impl TextExportWorker { match item { Group(g) => self.frame(&g.frame), Text(t) => { - write!(self.w, "{}", t.text.as_str()) + write!(self.w, " {}", t.text.as_str()) } - // Meta(ContentHint(c), _) => f.write_char(*c), Link(..) | Shape(..) | Image(..) => self.w.write_all(b"object"), Tag(..) => Ok(()), }