Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect .ipynb > .py > .ipynb roundtrip in simple and common cases #93

Open
lebigot opened this issue Aug 28, 2018 · 0 comments
Open

Comments

@lebigot
Copy link

lebigot commented Aug 28, 2018

If we have an .ipynb notebook that contains a first Markdown cell:

First Markdown text.

Then a second Markdown cell with two paragraphs:

Second Markdown text…

… with a second paragraph.

Then converting to .py and then back to .ipynb fails: the second cell is considered (commented out) code. This is a problem, because this situation is very likely to happen.

Also, if the first Markdown cell is a header (# This is a header), then the second Markdown cell is considered code through the roundtrip, which is a problem. Having a header cell and then some Markdown cell is another, common situation, for notebook.

PS: I tested this with the grst/ipymd version of ipymd, which apparently didn't touch this part of the code. The pip version (of rossant/ipymd) fails with:

  File "/…/anaconda/envs/py2/lib/python2.7/site-packages/ipymd/formats/notebook.py", line 80, in read
    assert nb['nbformat'] >= 4
TypeError: string indices must be integers, not str
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant