Markdown OKF-Schema Studio

Behaviour SwRS-MDOKFSTUDIO-GFM-016

Task list markers render as checkboxes with their source position

When a task-list item, paragraph, table cell, directive body or admonition title contains [ ], [x] or [X], the extension SHALL render a checkbox carrying its source line and UTF-16 column, marking a task-list item so that the checkbox replaces the bullet and keeping the checkbox input and its attributes in the sanitized webview HTML.

Step 1 of path 1 in StRS-MDOKFSTUDIO-GFM-003: from “A task-list item holds [ ]” to “The task shows a checkbox”.

Scenarios 6

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

nominalMarkers become checkboxes
Given'- [ ] a' in a list, '[x]' in a table cell, and a document with frontmatter
Whenthe preview is rendered
Theneach marker is a checkbox whose line and column equal the marker position, frontmatter lines included
boundaryLine and column counting
InputOutcome
a line with an astral character before '[ ]'the column counts UTF-16 units
a CRLF task listeach checkbox column equals its marker column, the same line and column as in the LF document
a document mixing LF and CRLF linesline numbers count each line break once
nominalTask-list checkboxes sit in the bullet gutter
InputOutcome
'- [ ] a' and '- [x] b'the items have task-list-item and the list has contains-task-list
'- a' without a markerno task-list class is added
refusalMarkers stay literal where they have another meaning
InputOutcome
`` `[ ]` `` (inline code)no checkbox
`\[ ]` (escape)no checkbox
`[x](url)` (link text)no checkbox
`## [ ] h` (ATX heading)no checkbox
[ ] or [x] in code, math, diagrams, URLs, images, raw HTML, directive arguments, wikilink or reference syntaxliteral text, no checkbox
boundaryDefined reference label
Givena document defining '[x]: url' and using '[x]' and '[ ]'
Whenthe preview is rendered
Then[x] stays a link and [ ] is a checkbox
nominalThe webview keeps checkbox inputs
Givenrendered HTML with a checkbox input, and a checked checkbox input with line and column attributes
Whenit is sanitized for the webview
Thenthe input and its source attributes remain, the checked state, line and column attributes all kept

Implemented in 3

Tested by 2

Replaces

SwRS-MDOKFSTUDIO-GFM-017Task-list checkboxes sit in the bullet gutter superseded superseded by SwRS-MDOKFSTUDIO-GFM-016 Markdown file
SwRS-MDOKFSTUDIO-GFM-018Checkbox markers stay literal where they have another meaning superseded superseded by SwRS-MDOKFSTUDIO-GFM-016 Markdown file
SwRS-MDOKFSTUDIO-GFM-019CRLF documents keep exact checkbox columns superseded superseded by SwRS-MDOKFSTUDIO-GFM-016 Markdown file
SwRS-MDOKFSTUDIO-GFM-020The webview keeps checkbox inputs superseded superseded by SwRS-MDOKFSTUDIO-GFM-016 Markdown file