Skip to content
1 change: 1 addition & 0 deletions marimo/_ast/codegen.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ def format_markdown(cell: CellImpl) -> str:
# We can blanket replace, because cell.markdown is not set
# on f-strings with values.
markdown = markdown.replace("{", "{{").replace("}", "}}")
markdown = markdown.replace('""', '"\\"')

# We always use """ as per front end.
body = construct_markdown_call(markdown, '"""', tag)
Expand Down
9 changes: 9 additions & 0 deletions marimo/_ast/load.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,15 @@

@dataclass
class LoadResult:
"""Result of attempting to load a marimo notebook.

status can be one of:
- empty: No content, or only comments / a doc string
- has_errors: Parsed, but has marimo-specific errors (**can load!!**)
- invalid: Could not be parsed as a marimo notebook (**cannot load**)
- valid: Parsed and valid marimo notebook
"""

status: Literal["empty", "has_errors", "invalid", "valid"] = "empty"
notebook: Optional[NotebookSerialization] = None
contents: Optional[str] = None
Expand Down
2 changes: 2 additions & 0 deletions tests/_ast/codegen_data/_test_not_parsable.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# INTENTIONALLY BROKEN!
print("hello world
27 changes: 27 additions & 0 deletions tests/_ast/codegen_data/_test_parse_error_in_notebook.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import marimo

__generated_with = "0.17.4"
app = marimo.App(width="medium")


@app.cell
def _(mo):
mo.md("""
r"""Markdown cell with error"""
""")
return


@app.cell
def _():
import marimo as mo
return (mo,)


@app.cell
def _():
return


if __name__ == "__main__":
app.run()
1 change: 0 additions & 1 deletion tests/_ast/codegen_data/test_get_app_kwargs.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import marimo

app = marimo.App(
app_title="title",
auto_download="html",
Expand Down
Loading
Loading