marimo-team / marimo

A reactive notebook for Python — run reproducible experiments, execute as a script, deploy as an app, and version with git.
https://marimo.io
Apache License 2.0
5.39k stars 158 forks source link

Backslashes added to fstring inside `mo.md()` #1727

Closed lborcard closed 3 days ago

lborcard commented 3 days ago

Describe the bug

Dear Marimo team,

Thank you for your tool I really enjoy it. I came accross this weird bug when using mo.md() where I come back to my app and I see that backslashes were added to my mo.md() when indexing a dict with a key ala mydict["A"]. error line 1 mo.md(f"###Size: {next_suggestion[\"s\"]:12}") ^ SyntaxError: f-string expression part cannot include a backslash

Environment

{ "marimo": "0.6.26", "OS": "Linux", "OS Version": "4.18.0-513.18.2.el8_9.x86_64", "Processor": "x86_64", "Python Version": "3.11.0", "Binaries": { "Browser": "--", "Node": "--" }, "Requirements": { "click": "8.1.7", "importlib-resources": "missing", "jedi": "0.19.1", "markdown": "3.6", "pymdown-extensions": "10.8.1", "pygments": "2.18.0", "tomlkit": "0.12.5", "uvicorn": "0.30.1", "starlette": "0.37.2", "websockets": "12.0", "typing-extensions": "missing", "black": "24.4.2" } }

Code to reproduce

No response

akshayka commented 3 days ago

Thank you for reporting! And thanks for the reproduction. We'll look into it.