Skip to content

Commit

Permalink
not r-strings, just escape
Browse files Browse the repository at this point in the history
  • Loading branch information
akshayka committed Sep 4, 2024
1 parent e767dbd commit 6788b63
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions marimo/_ast/codegen.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,7 @@ def generate_unparsable_cell(
def generate_app_constructor(config: Optional[_AppConfig]) -> str:
def _format_arg(arg: Any) -> str:
if isinstance(arg, str):
# Serialize string arguments as r-strings to handle backslashes
# in file paths
return f'r"{arg}"'
return f'"{arg}"'.replace("\\", "\\\\")
else:
return str(arg)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import marimo

__generated_with = "0.4.6"
app = marimo.App(width=r"full", app_title=r"test_title", css_file=r"a\b.css")
app = marimo.App(width="full", app_title="test_title", css_file="a\\b.css")



Expand Down

0 comments on commit 6788b63

Please sign in to comment.