From 1ac927066b39a3412f0c8999c38b124d67122f0c Mon Sep 17 00:00:00 2001 From: Marius Gedminas Date: Fri, 22 Nov 2024 09:27:25 +0200 Subject: [PATCH] Do not wrap text at no-break spaces Fixes #3545. --- rich/_wrap.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rich/_wrap.py b/rich/_wrap.py index 2e94ff6f4..f1c13e932 100644 --- a/rich/_wrap.py +++ b/rich/_wrap.py @@ -6,7 +6,7 @@ from ._loop import loop_last from .cells import cell_len, chop_cells -re_word = re.compile(r"\s*\S+\s*") +re_word = re.compile("\\s*[\\S\N{NO-BREAK SPACE}]+\\s*") def words(text: str) -> Iterable[tuple[int, int, str]]: