From 8211c253a83d9665a657298cecbfd1b7462e66af Mon Sep 17 00:00:00 2001 From: Mathieu Duponchelle Date: Fri, 16 Feb 2024 19:38:38 +0100 Subject: [PATCH] textwrap: don't split on all whitespaces .. but only on ASCII whitespaces, as we want to honor non-breaking whitespaces (\u{a0}) Part-of: --- text/wrap/src/gsttextwrap/imp.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/text/wrap/src/gsttextwrap/imp.rs b/text/wrap/src/gsttextwrap/imp.rs index 593bd714..c42036be 100644 --- a/text/wrap/src/gsttextwrap/imp.rs +++ b/text/wrap/src/gsttextwrap/imp.rs @@ -199,7 +199,7 @@ impl TextWrap { state.end_ts = buffer.pts(); - let words = data.split_whitespace(); + let words = data.split_ascii_whitespace(); let mut current_text = state.current_text.to_string(); for word in words {