Markdown OKF-Schema Studio

Behaviour SwRS-MDOKFSTUDIO-PALETTE-178

The host lists the label targets of the document

When the host answers previewListTargets, the extension SHALL list the lines (name)= of the current document text that are outside code fences and whose name starts with a letter or digit and holds only letters, digits, underscore, dot, colon and hyphen, in source order, each with the heading or first text line after it as detail clipped to 80 characters, at most 500 entries, and set the truncated flag when the list is cut.

Step 2 of path 1 in StRS-MDOKFSTUDIO-PALETTE-013: from “The host is asked for the labels” to “The labels are listed”.

Scenarios 5

The situations the tests check; open one to read it.

nominalLabels
Givena document with (intro)=, (plain-one)= and (a.b:c_d-1)=
Whenthe host answers previewListTargets
Thenthe three names are listed in source order
refusalFences and bad names
Givenlabels inside a backtick or tilde fence and (bad name)=
Whenthe host answers
Thenthey are not listed
boundaryDetail of a label
InputOutcome
(intro)= followed by # Introductionthe detail is Introduction
a label followed by a paragraph line of 120 charactersthe detail is 79 characters followed by an ellipsis
a label followed by other label lines and then a heading or a text linethe detail is that heading or line
a label followed by blanks inside the linethe blanks are collapsed in the detail
a label followed by nothingno detail
a label line with blanks around it and nothing elselisted
a name of more than 100 characters (the label length limit of the rename feature)not listed
boundarySize of the list
InputOutcome
505 label lines500 entries and truncated true
one label lineone entry and truncated false
nominalShape of the request and of the answer
Givena previewListTargets message with a non-empty editId of at most 100 characters
Whenthe host answers for the current document
ThenpreviewListTargetsResult repeats the editId and holds ok true, the items (value and label are the name, the detail is the heading or text) and the truncated flag; a message without a valid editId is ignored by the envelope check (see SwRS-MDOKFSTUDIO-TRUST-052), a stale or out-of-date request is answered or dropped by the gate (see SwRS-MDOKFSTUDIO-TRUST-065) and the answer is matched by its editId (see SwRS-MDOKFSTUDIO-TRUST-090)

Implemented in 1

Tested by 2