From b94825130a750124fd0e0f69e048ad305e7a44d2 Mon Sep 17 00:00:00 2001 From: Tsvika Shapira Date: Mon, 20 Jan 2025 16:52:30 +0200 Subject: [PATCH] fix: set string to raw set a string to raw. it is used in a regex, and the \ should be escaped to be visible to the regex. --- jupyterlab_code_formatter/formatters.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jupyterlab_code_formatter/formatters.py b/jupyterlab_code_formatter/formatters.py index 5c93fe2..612f07e 100644 --- a/jupyterlab_code_formatter/formatters.py +++ b/jupyterlab_code_formatter/formatters.py @@ -107,7 +107,7 @@ class RunScriptEscaper(BaseLineEscaper): unesacpe_start = len(escaped_line_start) def escape(self, line: str) -> str: - if re.match(pattern="run\s+\w+", string=line.lstrip()): + if re.match(pattern=r"run\s+\w+", string=line.lstrip()): line = f"{self.escaped_line_start}{line}" return line