microsoft / microsoft/vscode

Hybrid Markdown editor: newlines that exit a list are not rendered — drawn as inline ↵ markers until the next keystroke

Open
#329,464 3 comments 0 reactions 1 assignee Assigned to @hediet View on GitHub
Dominant language
TypeScript
Stars
193k
Forks
42.4k
PR merge metrics
PR metrics pending

Description

Type: Bug

- VS Code Version: 1.131.0 (stable, commit e4c7e7b1d6d060162f4aa7f8225271b67ce1df75, 2026-07-28)
- OS Version: macOS 26.5.2 (25F84), arm64

In the hybrid/experimental Markdown editor, pressing Enter at the end of a list item
updates the document correctly but the rendered view does not reflect it. The inserted newlines are
drawn as **inline `↵` markers appended to the list item's line**, and no new block appears. The
result is that exiting a list looks impossible even though the underlying text is what you wanted.

### Steps to reproduce

1. Create a `.md` file, open it in the hybrid Markdown editor, switch to Editing mode.
2. Enter a short document ending in a list, with **nothing after the list**:
```md
something

- item 1
- item 2
```
3. Put the caret at the end of `item 2` and press Enter a few times.

**Expected:** Enter starts a new list item; a second Enter on that empty item
exits the list, rendering a plain empty paragraph after the list with the caret in it.

**Actual:** the rendered line becomes `- item 2↵↵↵↵↵↵↵↵↵`, with a `↵` glyph added per keypress and
the caret apparently still inside the list item. There is no visible way out of the list.

### The document model is correct — only the rendering is wrong

Selecting the affected region and inspecting the text shows the editor **did** insert ordinary
newlines. The buffer contains exactly what you would want:

```md
something
- item 1
- item 2

```

i.e. `- item 2` followed by genuine blank lines — no hard-break backslashes, no single line with
escapes. So the edit is applied correctly to the text model and the renderer simply fails to
reflow: it never draws the new empty block, and instead paints the newlines as inline `↵` markers
on the preceding list item.

**The view corrects itself on the next keystroke.** If you press Enter twice and then
just start typing, the text appears in the correct place — outside the list, as a new paragraph —
and the `↵` markers disappear. Nothing was ever wrong with the edit; the rendered view is simply
stale between the newline insertion and the next input.

### Related symptom, likely the same cause

When there **is** an existing block after the list, double-Enter appears to move the
caret into that existing content rather than into a new empty paragraph between the list and it.
That is consistent with the same root cause: the newly created empty block is never rendered, so
the nearest thing the view can show is the block that already existed.

### Notes

- Appending to a list at the end of a document is a very common editing action, so this is easy to
hit within the first few minutes of using the editor.
- The conventional fallback of Shift+Tab to outdent out of the list was
unavailable in my setup because an installed extension binds that chord. Not a VS Code bug, but
it removes the workaround.
- Since the saved file is correct, the damage is confined to the editing experience — but the
editor is unusable for list-heavy documents until the view reflows.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.