Markdown OKF-Schema Studio

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
ModePalette button and `/toc` entry
strict, GFM and MySTlisted (group Block, after Horizontal rule)
table cell editornot listed (block scope only)

The `/` menu also finds the action by `toc`, `contents`, `table of contents`, `outline` and `summary`.

Implemented in 2

Tested by 1