From 70926afce6ac77dc82b30c4738d2681fda34e49d Mon Sep 17 00:00:00 2001 From: LUIS NOVO Date: Tue, 29 Oct 2024 07:28:02 -0300 Subject: [PATCH] fix issue with special spaces --- open_notebook/utils.py | 1 + 1 file changed, 1 insertion(+) diff --git a/open_notebook/utils.py b/open_notebook/utils.py index fe8ce42..ab43172 100644 --- a/open_notebook/utils.py +++ b/open_notebook/utils.py @@ -87,6 +87,7 @@ def remove_non_printable(text): text = "".join( char for char in text if unicodedata.category(char)[0] != "C" or char in "\n\t" ) + text = text.replace("\xa0", " ").strip() # Keep letters (including accented ones), numbers, spaces, newlines, tabs, and basic punctuation return re.sub(r"[^\w\s.,!?\-\n\t]", "", text, flags=re.UNICODE)