StackExchange / StackExchange/Stacks-Editor

GH editor-like (un)ordered list bullet auto insertion

Open
#87 3 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

Is your feature request related to a problem? Please describe.
On the Markdown mode, I expect:

  1. Hitting enter seems like it would give me another number when I already am on a numbered line.
  2. Hitting enter again I'd assume it would delete the number if no other text was present.
  3. Hitting again (without the number on a line) I'd assume it would create a new line, as expected, normal enter behavior.

THIS Github EDITOR I'M IN RIGHT NOW DOES EXACTLY WHAT I'M ASKING FOR :)

We can do one better though, if we're on a line below a numbered line, say we're editing an existing list:
I expect that we would interpret the previous line and make the next number if there are no newlines or lines of text in between.
I don't think that would delay things too much since you only have to look at the beginning of the line and the next couple of characters with a compiled regex or w/e.

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

No file or test is named. Start by locating the Markdown mode input and list-handling logic, then trace how Enter currently processes numbered and unordered list lines. Done means matching the described continuation, list-exit, and normal-newline behavior, with coverage for each case.

Written by the indexing model from the issue text.

Assessment

Tech stack
markdown, typescript
Domain
frontend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.