textwrap: don't split on all whitespaces ..

but only on ASCII whitespaces, as we want to honor non-breaking
whitespaces (\u{a0})

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1468>
This commit is contained in:
Mathieu Duponchelle 2024-02-16 19:38:38 +01:00
parent 2572afbf15
commit 8f3a6171ac

View file

@ -199,7 +199,7 @@ impl TextWrap {
state.end_ts = buffer.pts(); 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(); let mut current_text = state.current_text.to_string();
for word in words { for word in words {