From 3f7d5c68c2a45ceb1bfd64f23115fd76fb5be76c Mon Sep 17 00:00:00 2001 From: Waldir Pimenta Date: Fri, 25 Nov 2022 11:42:30 +0000 Subject: [PATCH] Copyedit the grid table extension documentation --- src/Markdig.Tests/Specs/GridTableSpecs.md | 43 ++++++++++++----------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/src/Markdig.Tests/Specs/GridTableSpecs.md b/src/Markdig.Tests/Specs/GridTableSpecs.md index 0edf3b2e..de4618cf 100644 --- a/src/Markdig.Tests/Specs/GridTableSpecs.md +++ b/src/Markdig.Tests/Specs/GridTableSpecs.md @@ -4,7 +4,8 @@ This section describes the different extensions supported: ## Grid Table -A grid table allows to have multiple lines per cells and allows to span cells over multiple columns. The following shows a simple grid table +A grid table allows having multiple lines per cells and allows spanning cells over multiple columns. +The following shows a simple grid table: ``` +---------+---------+ @@ -25,17 +26,20 @@ A grid table allows to have multiple lines per cells and allows to span cells ov ``` **Rule #1** -The first line of a grid table must a **row separator**. It must start with the column separator character `+` used to separate columns in a row separator. Each column separator is: - - starting by optional spaces - - followed by an optional `:` to specify left align, followed by optional spaces - - followed by a sequence of at least one `-` character, followed by optional spaces - - followed by an optional `:` to specify right align (or center align if left align is also defined) - - ending by optional spaces +The first line of a grid table must be a **row separator**. +It must start with the column separator character `+` used to separate columns in a row separator. -The first row separator must be followed by a *regular row*. A regular row must start with the character `|` that is starting at the same position than the column separator `+` of the first row separator. +Each column separator: +- starts with optional spaces +- followed by an optional `:` to specify left align, followed by optional spaces +- followed by a sequence of one or more `-` characters, followed by optional spaces +- followed by an optional `:` to specify right align (or center align if left align is also defined) +- ends with optional spaces +The first row separator must be followed by a *regular row*. +A regular row must start with a `|` character starting at the same position as the column separator `+` of the first row separator. -The following is a valid row separator +The following is a valid row separator: ```````````````````````````````` example +---------+---------+ @@ -53,8 +57,8 @@ The following is a valid row separator ```````````````````````````````` +The following is not a valid row separator: -The following is not a valid row separator ```````````````````````````````` example |-----xxx----+---------+ | This is | not a table @@ -64,7 +68,8 @@ The following is not a valid row separator ```````````````````````````````` **Rule #2** -A regular row can continue a previous regular row when column separator `|` are positioned at the same position than the previous line. If they are positioned at the same location, the column may span over multiple columns: +A regular row can continue a previous regular row when the column separators `|` are positioned at the same position as those of the previous line. +If they are positioned at the same location, the column may span over multiple columns: ```````````````````````````````` example +---------+---------+---------+ @@ -134,15 +139,13 @@ The last column separator `|` may be omitted: ```````````````````````````````` -The respective width of the columns are calculated from the ratio between the total size of the first table row without counting the `+`: `+----+--------+----+` would be divided between: +The respective widths of the columns are calculated from the ratio between the total size of the first table row without counting the `+`: `+----+--------+----+` would be divided between: -Total size is : 16 +- `----` → 4 characters +- `--------` → 8 characters +- `----` → 4 characters -- `----` -> 4 -- `--------` -> 8 -- `----` -> 4 - -So the width would be 4/16 = 25%, 8/16 = 50%, 4/16 = 25% +The total size is 16 characters, so the widths would be 4/16 = 25%, 8/16 = 50%, and 4/16 = 25%. ```````````````````````````````` example +----+--------+----+ @@ -165,7 +168,6 @@ So the width would be 4/16 = 25%, 8/16 = 50%, 4/16 = 25% Alignment might be specified on the first row using the character `:`: - ```````````````````````````````` example +-----+:---:+-----+ | A | B | C | @@ -220,7 +222,7 @@ D ```````````````````````````````` -A grid table may have cells with both colspan and rowspan: +A grid table may have cells with both `colspan` and `rowspan`: ```````````````````````````````` example +---+---+---+ @@ -276,7 +278,6 @@ A grid table may not have irregularly shaped cells: An empty `+` on a line should result in a simple empty list output: - ```````````````````````````````` example + .