Behaviour SwRS-MDOKFSTUDIO-TABLE-117
HTML table converts or inserts an HTML table
When the writer runs HTML table, the extension SHALL replace the pipe table at the caret with an HTML table whose first row is in thead and whose other rows are in tbody, and, with the caret outside a pipe table, insert a new HTML table of two columns and one empty body row after the selection, set apart by blank lines, with Column 1 selected.
Another outcome at step 2 of path 1 in StRS-MDOKFSTUDIO-TABLE-016, in the state “A pipe table is in the text”.
Scenarios 8
The situations the tests check; open one to read it.
nominalCaret on header, delimiter or last row
Giventhe caret in the header, in the delimiter row and in the last row of a pipe table, in turn, or in a table that follows text
WhenHTML table is run
Thenthe whole pipe table is replaced each time
boundaryEscaped text
Givencells containing &, < and >, and an escaped pipe
Whenthe table is converted
Then&, < and > are escaped as entities, the escaped pipe becomes a pipe, and other text is kept as typed
nominalAlignment, empty cells and unicode
Givena table with :---, :---: and ---: columns, an empty cell and non-ASCII text
Whenit is written as HTML
Thenthe cells carry align left, center and right, the empty cell is an empty element and the text is unchanged
boundaryNo body rows
Givena header and its delimiter row only
Whenit is written as HTML
Thenthe result has thead only and no tbody, and no align attribute for a column without colons
nominalCaret in a paragraph
Giventhe caret in a paragraph
WhenHTML table is run
Thena table element with a header of Column 1 and Column 2 and one empty body row is inserted on its own lines, with Column 1 selected
boundaryCaret in a list-table or an HTML table
Giventhe caret inside a {list-table} or an HTML table
WhenHTML table is run
Thenthe new table is inserted on its own lines after the last line of that table, which stays whole
refusalA row with text after its closing pipe
Giventhe caret in a pipe table with a token after the closing pipe of a row, such as "| alpha | 1 | ^row-a"
WhenHTML table is run
Thenno edit is produced: the table is not converted and no new table is inserted, because the text would be lost
boundaryNo table tools
Giventhe page without table tools
WhenHTML table is run
Thenthe same new table is inserted