Markdown OKF-Schema Studio

Behaviour SwRS-MDOKFSTUDIO-GFM-040

A radio choice list renders as a radio group

When a list holds at least two consecutive items that start with '( )', '(x)' or '(X)', the extension SHALL render them as one labelled radio group with one tab stop, whose controls replace the markers and the bullets.

Step 1 of path 1 in StRS-MDOKFSTUDIO-GFM-005: from “A list holds consecutive items that start with '( )' or '(x)'” to “The items are shown as a radio group”.

Scenarios 3

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

nominalA radio group renders labelled, with one tab stop
Giventhe paragraph 'Fix direction:' followed by the list '- (x) A', '- ( ) B', '- ( ) C'
Whenthe document renders, in any palette mode (Strict, GFM, MyST or Full: the mode changes only the palette buttons)
Thenthe list carries role="radiogroup" and aria-labelledby naming the paragraph, each item shows a round control with role="radio", aria-checked "true" for A and "false" for B and C, its source line and UTF-16 column, and the selected option (else the first) is the only one with tabindex 0; the list, its items and the option paragraphs carry tabindex -1 (focusable by a click or a script, out of the Tab order; the list stays a mapped block), so one Tab from the label paragraph lands on the selected option; the controls replace the markers and the bullets
boundaryWhich items form a group
InputOutcome
a single '( )' or '(x)' item in its runstays plain text '( ) ...'
'(X)'a selected option; it is left as written unless a click selects another option
'(x)' with no space or tab after it, '(y)', '(x)' in a paragraph or not at the start of the itemplain text
a blank line between two radio itemsends the group; each run of at least two items is a group of its own
a heading, a list with another bullet or ordered marker, or a non-radio item between two radio itemsends the group
a list that mixes '[ ]' and '( )' itemsthe '[ ]' items stay checkboxes; a run of at least two '( )' items is a radio group owned by an empty role="radiogroup" element (aria-owns), and only a group that starts the list is labelled by the paragraph above it; the option items and paragraphs carry tabindex -1, the list keeps its own tab stop
an ordered list of radio items ('1. ( )', '2. (x)')one group; each item keeps its number and shows the control after it
no '(x)' in the groupevery option renders unselected, the first is the tab stop
two '(x)' in the groupboth render selected, as written
a nested list of radio itemsforms its own group, labelled by its parent item's text
markers in code, in a block quote or after frontmatter, CRLF filesliteral in code; elsewhere the line and column are those of the document
boundaryThe sanitized webview HTML keeps the group
Givena rendered radio group
Whenthe HTML is sanitized for the webview
Thenit keeps the roles, the states, the ids, the source attributes and the tabindex -1 of the list, items and option paragraphs (a mapped block that already has a tabindex keeps it)

Implemented in 3

Tested by 4

Replaces

SwRS-MDOKFSTUDIO-GFM-039Radio choice lists render as a radio group and a click moves the selection in the source superseded superseded by SwRS-MDOKFSTUDIO-GFM-040, SwRS-MDOKFSTUDIO-GFM-041 Markdown file