Skip to content

Commit

Permalink
Fix: Support multiline cell contents
Browse files Browse the repository at this point in the history
  • Loading branch information
manzt committed Oct 20, 2024
1 parent 967fa08 commit 1905798
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/juv/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,12 @@ def to_notebook(fp: pathlib.Path) -> tuple[Pep723Meta | None, str]:
content = fp.read_text()
for cell in json.loads(content).get("cells", []):
if cell.get("cell_type") == "code":
meta = parse_pep723_meta(cell["source"])
source = (
isinstance(cell["source"], list)
and "".join(cell["source"])
or cell["source"]
)
meta = parse_pep723_meta(source)
return meta, content

return None, content
Expand Down

0 comments on commit 1905798

Please sign in to comment.