You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Extension version (available under the Extensions sidebar): 2018.12.1
OS and version: Windows_NT x64 10.0.17134
Python version (& distribution if applicable, e.g. Anaconda): 3.6.8
Type of virtual environment used (N/A | venv | virtualenv | conda | ...): conda
Relevant/affected Python packages and their versions: none
Expected behaviour
When I export a .py file (which is imported from an .ipynb) to a .ipynb, the new Jupyter notebook should be the same as the original. Especially the markdown portion should not break.
Actual behaviour
Markdown portion breaks because the blanks on the left of each line are removed when exporting .py to .ipynb.
Steps to reproduce:
import a notebook from vscode. Import is okay.
{
"cells": [
{
"metadata": {
"collapsed": true
},
"cell_type": "markdown",
"source": "# Simple Notebook to replicate the issue\n\n## Issue\nWhen export .py with #%% markdown blocks, blanks on the left of each line are removed, breaking the intended markdown format.\n"
},
{
"metadata": {},
"cell_type": "markdown",
"source": "## Block of Interest\n\n### Take a look\n\n\n 1. Item 1\n\n - Item 1-a\n 1. Item 1-a-1\n - Item 1-a-1-a\n - Item 1-a-1-b\n 2. Item 1-a-2\n - Item 1-a-2-a\n - Item 1-a-2-b\n 3. Item 1-a-3\n - Item 1-a-3-a\n - Item 1-a-3-b\n - Item 1-a-3-c\n\n 2. Item 2"
}
],
"metadata": {
"kernelspec": {
"name": "python36",
"display_name": "Python 3.6",
"language": "python"
},
"language_info": {
"mimetype": "text/x-python",
"nbconvert_exporter": "python",
"name": "python",
"pygments_lexer": "ipython3",
"version": "3.6.6",
"file_extension": ".py",
"codemirror_mode": {
"version": 3,
"name": "ipython"
}
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Export the imported .py to .ipynb. The blanks are removed on the left of each line, breaking the intended format.
Logs
Output for Python in the Output panel (View→Output, change the drop-down the upper-right of the Output panel to Python)
You can try exporting below Python script for replication.
#%% [markdown]
# # Simple Notebook to replicate the issue
#
# ## Issue
# When export .py with #%% markdown blocks, blanks on the left of each line are removed, breaking the intended markdown format.
#
#%% [markdown]
# ## Block of Interest
#
# ### Take a look
#
#
# 1. Item 1
#
# - Item 1-a
# 1. Item 1-a-1
# - Item 1-a-1-a
# - Item 1-a-1-b
# 2. Item 1-a-2
# - Item 1-a-2-a
# - Item 1-a-2-b
# 3. Item 1-a-3
# - Item 1-a-3-a
# - Item 1-a-3-b
# - Item 1-a-3-c
#
# 2. Item 2
Output from Console under the Developer Tools panel (toggle Developer Tools on under Help; turn on source maps to make any tracebacks be useful by running Enable source map support for extension debugging)
N/A
The text was updated successfully, but these errors were encountered:
Environment data
Expected behaviour
When I export a .py file (which is imported from an .ipynb) to a .ipynb, the new Jupyter notebook should be the same as the original. Especially the markdown portion should not break.
Actual behaviour
Markdown portion breaks because the blanks on the left of each line are removed when exporting .py to .ipynb.
Steps to reproduce:
Logs
Output for
Python
in theOutput
panel (View
→Output
, change the drop-down the upper-right of theOutput
panel toPython
)You can try exporting below Python script for replication.
Output from
Console
under theDeveloper Tools
panel (toggle Developer Tools on underHelp
; turn on source maps to make any tracebacks be useful by runningEnable source map support for extension debugging
)N/A
The text was updated successfully, but these errors were encountered: