From 6d735e76cc61b4dd8028e09b425b304808ed8450 Mon Sep 17 00:00:00 2001 From: tretrauit Date: Sun, 7 Jan 2024 20:59:49 +0700 Subject: [PATCH] fix(katana): replace all, not just once --- swordfish/src/katana.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/swordfish/src/katana.rs b/swordfish/src/katana.rs index d07144e..887b60f 100644 --- a/swordfish/src/katana.rs +++ b/swordfish/src/katana.rs @@ -118,7 +118,9 @@ fn fix_tesseract_string(text: &mut String) { } // Replace "\n" with " " trace!("Text: {}", text); - replace_string(text, "\n", " "); + while replace_string(text, "\n", " ") { + trace!("Replacing '\\n' with ' '"); + } // Remove all non-alphanumeric characters trace!("Text: {}", text); text.retain(|c| {