Skip to content

Commit 5772a90

Browse files
authored
Fix markdown cell marker formatting for export to Python (microsoft#14360)
1 parent 5583df4 commit 5772a90

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

news/2 Fixes/14359.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix markdown cell marker when exporting a notebook to a Python script.

src/client/datascience/jupyter/jupyterImporter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export class JupyterImporter implements INotebookImporter {
3636
{% endblock codecell %}
3737
{% block in_prompt %}{% endblock in_prompt %}
3838
{% block input %}{{ cell.source | ipython2python }}{% endblock input %}
39-
{% block markdowncell scoped %}{0} [markdown]
39+
{% block markdowncell scoped %}{1} [markdown]
4040
{{ cell.source | comment_lines }}
4141
{% endblock markdowncell %}`;
4242
private readonly nbconvert5Null = 'null.tpl';

src/test/datascience/notebook.functional.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -676,6 +676,7 @@ suite('DataScience notebook tests', () => {
676676

677677
// Make sure we have a cell in our results
678678
assert.ok(/#\s*%%/.test(results), 'No cells in returned import');
679+
assert.ok(!results.includes('tpl'), 'Formatted template with wrong arguments');
679680
} finally {
680681
try {
681682
importer.dispose();

0 commit comments

Comments
 (0)