vscode-markdown icon indicating copy to clipboard operation
vscode-markdown copied to clipboard

Incorrect second-level list renumbering on line delete

Open minimusubi opened this issue 1 year ago • 2 comments

Problem

An issue occurs with the automatic renumbering feature of ordered lists. When removing an entire line containing a top level list item, the automatic renumbering does not restart numbering between second level lists, and incorrectly "continues" the numbering instead.

At first glance, #668 appears as a related issue; however, I believe this is a separate issue.

How to reproduce

Start with this markdown:

1. Item to be deleted
2. First level 1
	1. Second level 1
	2. Second level 2
3. First level 2
	1. Second level 1
	2. Second level 2
3. First level 3
	1. Second level 1
	2. Second level 2

Then, delete the entire line containing Item to be deleted. Observe that the items within First level 2 and First level 3 are incorrectly numbered. Expected output:

1. First level 1
	1. Second level 1
	2. Second level 2
2. First level 2
	1. Second level 1
	2. Second level 2
3. First level 3
	1. Second level 1
	2. Second level 2

Actual output:

1. First level 1
	1. Second level 1
	2. Second level 2
2. First level 2
	3. Second level 1
	4. Second level 2
3. First level 3
	5. Second level 1
	6. Second level 2

GIF Demonstration

Export

Configuration

Default. (Tested on fresh install of VS Code with only this extension installed)

Environment

  • Markdown All in One: 3.4.3
  • VS Code: 1.70.0 (user setup)
  • OS: Windows 10 Pro, Version 21H2, Build 19044.1826, 64-bit

Diagnostic data

No relevant messages in the developer console log.

minimusubi avatar Aug 08 '22 01:08 minimusubi

You are right. That is a bug.

yzhang-gh avatar Aug 08 '22 04:08 yzhang-gh

Please try out the dev build.

yzhang-gh avatar Aug 13 '22 13:08 yzhang-gh

Hi @yzhang-gh , it looks like with the latest release (3.5.0) the bug is partially fixed. While the second-level numbered list renumbering works fine by now, the more deeply nested ones still break.

CleanShot 2023-03-05 at 17 56 56

Naitreey avatar Mar 05 '23 10:03 Naitreey

Thanks. Please try out the latest dev build.

yzhang-gh avatar Mar 05 '23 12:03 yzhang-gh