Skip to content

Content Editor: Support task lists in client-side Markdown parser

What does this MR do and why?

  • NOTICE: This change is behind a the preserve_unchanged_markdown feature flag.
  • Context: This change is part of a larger effort to preserve unchanged Markdown in the Content Editor. For this effort, we need to support client-side parsing of Markdown content.

It implements support for task lists in the client-side Markdown parser being implemented in the Content Editor. This change makes sure that when the user doesn’t change a task list or even task list item, the Content Editor won’t generate new Markdown for that content. It will restore the original Markdown source to avoid introducing unnecessary changes in the Markdown document.

Screenshots or screen recordings

2022-05-19_12.52.22

How to set up and validate locally

  • Enable the preserve_unchanged_markdown feature flag.

  • Edit or create a Wiki page in your local environment.

  • Add the following task lists in the Classic Markdown Editor

    - [ ] Task list 1
    - [ ] Task list 2
    
    * [ ] Task list 1
    * [ ] Task list 2
    
    1) [ ] Task list 1
    2) [ ] Task list 2
  • Switch to rich text mode

  • You can edit or check either of the task items. You will notice that syntax preferences such as the bullet symbol (- or * or 1)) are preserved by the Content Editor.

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 #359016 (closed)

Edited by Enrique Alcántara

Merge request reports