Update export_to_ipynb.py

fixing script to handle xkcd.py as well
This commit is contained in:
Kevin Mader
2018-08-03 10:26:25 +02:00
committed by GitHub
parent 1f604408e6
commit e91c16c214

View File

@@ -12,6 +12,7 @@ nbook = v4.upgrade(nbook) # Upgrade v3 to v4
all_blocks = ast.parse(text).body
line_start = [c.lineno-1 for c in all_blocks]
line_start[0] = 0
lines = text.split('\n')
for c_block, s, e in zip(all_blocks, line_start, line_start[1:]+[len(lines)]):