Microsoft/vscode

Line breaks for multi-line comments in Markdown cells are broken (interactive Python)

Open

#269,627 创建于 2022年4月7日

在 GitHub 查看
 (3 评论) (2 反应) (2 负责人)TypeScript (10,221 fork)batch import
bughelp wantedinteractive-window

仓库指标

Star
 (74,848 star)
PR 合并指标
 (平均合并 11小时 43分钟) (30 天内合并 1,000 个 PR)

描述

Applies To

  • Notebooks (.ipynb files)
  • Interactive Window and/or Cell Scripts (.py files with #%% markers)

What happened?

In a .py file, I wrote a markdown cell with python strings (multiple line comments):

#%% [markdown]

"""
# H1 Title

description 1

- item 1
    - item 2
- item 3

description 2

- item 4
    - item 5
- item 6
"""

I run the cell (ctrl + enter), but it shows:

Screen Shot 2022-04-07 at 11 15 05

The line breaks and the indentation of list items are incorrect.

Additionally, writing code block within python comments

#%% [markdown]

"""
Writing code blocks in markdown:

```shell
# Comment 1
$ ls 

# Comment 2
$ ls -lh
```
"""

shows no line breaks:

Screen Shot 2022-04-07 at 12 09 27

VS Code Version

1.66.0

Jupyter Extension Version

v2022.3.1000901801

Jupyter logs

No response

Coding Language and Runtime Version

Python 3.10.2

Language Extension Version (if applicable)

v2022.4.0

Anaconda Version (if applicable)

No response

Running Jupyter locally or remotely?

Local

贡献者指南