StackExchange / StackExchange/Stacks-Editor

Applying a [numbered / bulleted] list to multiple lines works differently in each mode

Open
#216 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement mode - markdown
Dominant language
TypeScript
Stars
437
Forks
61
Avg merge
16h 2m
Merged PRs (30d)
8

Description

Describe the bug

Markdown mode:

  • After selecting and applying a numbered list, the numbers assigned to each line are the same. Switching to rich text [and back to Markdown] fixes the numbering. This is not a bug, as Marijn notes in a comment on MSE, but it would be nice to have it apply the proper numbering in the first go itself (like in the Github editor).
  • Compared to rich text mode (and the old editor), the numbering is applied to all the lines. In the case of bulleted lists, the bullet points are also applied to all the lines in Markdown mode.
  • In the case of double line breaks, the [numbers / bullet points] are applied to blank spaces as well (as shown in the GIF below).

Rich text mode:

  • After selecting all the lines, with either single or double line breaks, and applying a numbered list in rich text mode, the numbering is only applied to the first item in the list, as is the case in the old editor. This is also the case with bulleted lists.

To Reproduce
Steps to reproduce the behavior:

  1. Type text on multiple lines with single line breaks.
  2. Select all lines.
  3. Apply [Numbered / Bulleted] list to the selected text in Markdown mode.
  4. Repeat using double line breaks.
  5. Repeat the above in rich text mode.
  6. Observe the difference.

Expected behavior
Make the way numbering is applied consistent in both modes.

Screenshots

  1. Single line break applied:

    enter image description here

  2. Double line break applied:

    enter image description here

  3. Comparison with the old editor:

enter image description here

Desktop (please complete the following information):

  • OS: Windows 11
  • Browser: Chrome
  • Version: 104.0.5112.101

Additional context
Also on MSE: https://meta.stackexchange.com/a/380604/513150

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the numbered and bulleted list steps in Markdown mode and rich text mode, including single and double line breaks, then compare the results with the expected consistent behavior. No source file or test is named; done means both modes apply list markers consistently without numbering blank lines.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.