diff --git a/taipy/gui/_renderers/__init__.py b/taipy/gui/_renderers/__init__.py index d0250b2968..b0e5c76d5b 100644 --- a/taipy/gui/_renderers/__init__.py +++ b/taipy/gui/_renderers/__init__.py @@ -99,11 +99,8 @@ def __parse_file_content(self, content): self._filepath = content def __sanitize_content(self, content: str) -> str: - # replace all CRLF (\r\n) with LF (\n) - text = re.sub(r'\r\n', '\n', content) - # replace all remaining CR (\r) with LF (\n) - text = re.sub(r'\r', '\n', content) - return text + # Replace all CRLF (\r\n) and CR (\r) by LF (\n) + return re.sub(r"\r", "\n", re.sub(r"\r\n", "\n", content)) def set_content(self, content: str) -> None: if not _is_in_notebook():