Skip to content

Display table of contents in content editor

Himanshu Kapoor requested to merge 366525-content-editor-table-of-contents into master

What does this MR do and why?

Allow inserting and displaying table of contents in the content editor, that live update each time you update a heading inside the document.

Screenshots or screen recordings

Screen_Recording_2022-07-13_at_11.09.28_AM

How to set up and validate locally

  1. Edit a wiki page
  2. Enter content with lots of headings, either in raw markdown view or in rich text view. Example below:

# heading 1

## heading 1.1

### heading 1.1.1

## heading 1.2

### heading 1.2.1

# heading 2

## heading 2.1

### heading 2.1.1

## heading 2.2

### heading 2.2.1

#### heading 5

## heading 2.3

### heading 2.3.1

##### heading 2.3.1.0.1
  1. In rich text view, click the + dropdown and select Table of contents
  2. A table of contents list should appear in the content editor
  3. Try updating any of the headings. The table of contents should live update automatically.

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

Edited by Himanshu Kapoor

Merge request reports