Behaviour SwRS-MDOKFSTUDIO-PALETTE-003
The Table of contents action inserts a [TOC] marker
When the user runs the Table of contents action from the edition palette or the /toc entry of the slash menu in a block editor, the editor SHALL insert a [TOC] line set apart by blank lines after the line the selection ends on and place the caret after it, in every palette mode.
Part of StRS-MDOKFSTUDIO-PALETTE-019, outside the paths drawn on its map.
Scenarios 2
The situations the tests check; open one to read it.
nominalInsertion
Givena block editor with the caret in a paragraph
Whenthe Table of contents button is pressed, or `/toc` is chosen in the slash menu
Thena `[TOC]` line is written after the paragraph, set apart by one blank line before and after, and the caret is placed after the marker
boundaryListing
| Mode | Palette button and `/toc` entry |
|---|---|
| strict, GFM and MyST | listed (group Block, after Horizontal rule) |
| table cell editor | not listed (block scope only) |
The `/` menu also finds the action by `toc`, `contents`, `table of contents`, `outline` and `summary`.