Skip to content

Auto-increment markdown lists

Brett Walker requested to merge 352974-auto-increment-markdown-list into master

What does this MR do and why?

Based on feedback on auto-numbering markdown ordered lists, this changes the behavior in two ways:

  1. changes from "single numbering"

    1. one
    1. two
    1. three

    to "incremental numbering"

    1. one
    2. two
    3. three

    When adding a new list item to the end of a list, we will increment the number, rather than repeating it.

    As mentioned in #352974 (comment 849307359), the use of "single numbering" is a GitLab created style

    It is only a GitLab guidance that we try to list as 1.,1.,1..

    To be practical and avoid errors on the numbers, use "1" for all the items. The markdown engine will output them in the correct order.

    and is not necessarily what users expect.

  2. When adding a new list item between two list items, for example between 2. and 3., we will not increment the number, but instead use the number of the previous item. This makes it obvious that a new item has been inserted, but maintains some "reasonable" numbering, without requiring the editor to detect and renumber other tasks.

    1. one
    2. two
    2. four
    3. three

Screenshots or screen recordings

2022-02-19_18.18.51

How to set up and validate locally

  1. Enable the markdown_continue_lists feature flag in the rails c

    Feature.enable(:markdown_continue_lists)

  2. Edit a description or comment and add markdown lists like you normally would

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #352974 (closed)

Edited by Brett Walker

Merge request reports

Loading