Skip to content

Content editor: Deserialize table of contents using the client-side parser

What does this MR do and why?

CONTEXT These changes are behind the preserve_unchanged_markdown feature flag.

This MR implements support for client-side deserialization of table of contents in the Content Editor. This means that table of contents elements are parsed/rendered in the web browser instead of using the

This MR also creates specs for tables of contents in the GitLab Flavored Markdown specs: !96701 (cea1867f)

Screenshots or screen recordings

Before After
2022-08-31_14.33.33 Content editor with support for table of contents

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

  1. Enable the preserve_unchanged_markdown feature flag.
  2. Create or edit a Wiki page.
  3. Paste the following Markdown snippet in the classic markdown editor:
    [[_TOC_]]
    
    # Heading 1
    
    Heading 1
    
    ## Heading 2
    
    Heading 2
  4. Switch to "Rich Text" mode.
  5. You should see a table of contents element.

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

Edited by Enrique Alcántara

Merge request reports

Loading