|
| 1 | +# Regression Testing Examples |
| 2 | + |
| 3 | +Instructions: Open this file with `set wrap` enabled. Walk through each |
| 4 | +numbered section matching the regression matrix. |
| 5 | + |
| 6 | +--- |
| 7 | + |
| 8 | +## 1 — Concealed content: table with long URLs renders |
| 9 | + |
| 10 | +The table below has long URLs that get concealed. It should still render |
| 11 | +as a proper table (borders, padding, alignment) — not fall back to raw text. |
| 12 | + |
| 13 | +| Feature | Status | Docs | |
| 14 | +|---------|--------|------| |
| 15 | +| **Bold** | ✅ Done | [spec](https://spec.commonmark.org/0.31.2/#emphasis-and-strong-emphasis-with-asterisks-and-underscores-rule-1-through-17) | |
| 16 | +| `code` | ⚠️ Partial | [GFM](https://github.github.com/gfm/#strikethrough-extension-with-tildes-and-double-tildes-for-del-elements) | |
| 17 | +| Nested lists | 🔧 WIP | [deep](https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#nested-lists-ordered-and-unordered-mixing-indentation-levels) | |
| 18 | + |
| 19 | +--- |
| 20 | + |
| 21 | +## 2 — Wrap continuation lines show table borders |
| 22 | + |
| 23 | +Shrink the window width until the table above wraps. Continuation lines |
| 24 | +should show `│...│` table borders — not raw text leaking through. |
| 25 | + |
| 26 | +(Use the same table from §1 above. Narrow the window to ~60 columns.) |
| 27 | + |
| 28 | +--- |
| 29 | + |
| 30 | +## 3 — Strikethrough doesn't inflate column widths |
| 31 | + |
| 32 | +The `~~Strikethrough~~` column should be the same visual width as the text |
| 33 | +without the `~~` markers. Compare column widths with and without. |
| 34 | + |
| 35 | +| Style | Example | Notes | |
| 36 | +|-------|---------|-------| |
| 37 | +| Plain | hello | baseline | |
| 38 | +| ~~Strikethrough~~ | ~~deleted~~ | width should match "deleted" | |
| 39 | +| **Bold** | **strong** | width should match "strong" | |
| 40 | + |
| 41 | +--- |
| 42 | + |
| 43 | +## 4 — Table borders use MarkviewTable* highlights |
| 44 | + |
| 45 | +All table borders (`│`, `─`, `┼`, `╭`, `╮`, etc.) should use `MarkviewTableBorder` |
| 46 | +or `MarkviewTableHeader` highlight groups — not treesitter `@punctuation.special`. |
| 47 | + |
| 48 | +Inspect the borders of this table: |
| 49 | + |
| 50 | +| A | B | |
| 51 | +|---|---| |
| 52 | +| 1 | 2 | |
| 53 | + |
| 54 | +--- |
| 55 | + |
| 56 | +## 5 — Right border on first screen row of wrapping lines |
| 57 | + |
| 58 | +When a table row wraps, the **first** screen row of that wrapped line should |
| 59 | +still have a right border `│` at the correct position. |
| 60 | + |
| 61 | +(Use the long-URL table from §1. Shrink window until rows wrap. Check the |
| 62 | +right edge of the first screen row of each wrapping line.) |
| 63 | + |
| 64 | +--- |
| 65 | + |
| 66 | +## 6 — Top/bottom border indent for nested tables (list context) |
| 67 | + |
| 68 | +The table below is inside an ordered list. The top and bottom borders should |
| 69 | +be indented to align with the table content — not flush-left. |
| 70 | + |
| 71 | +1. Here is an item with a nested table: |
| 72 | + |
| 73 | + | Key | Val | |
| 74 | + |-----|-----| |
| 75 | + | `x` | 42 | |
| 76 | + | `y` | 99 | |
| 77 | + |
| 78 | +2. Another list item. |
| 79 | + |
| 80 | +And a deeper nesting: |
| 81 | + |
| 82 | +1. Level 1 |
| 83 | + - Level 2 |
| 84 | + 1. Level 3 table: |
| 85 | + |
| 86 | + | A | B | C | |
| 87 | + |---|---|---| |
| 88 | + | 1 | 2 | 3 | |
| 89 | + |
| 90 | + 2. Back to list. |
| 91 | + |
| 92 | +--- |
| 93 | + |
| 94 | +## 7 — Separator decorations stable in hybrid mode |
| 95 | + |
| 96 | +Move your cursor in and out of the table below. The separator row decorations |
| 97 | +(`─`, `╶`, `┼`) should **not** swap order when the cursor enters/leaves. |
| 98 | + |
| 99 | +| Left | Center | Right | |
| 100 | +|:-----|:------:|------:| |
| 101 | +| aaa | bbb | ccc | |
| 102 | +| ddd | eee | fff | |
| 103 | + |
| 104 | +Also test with cursor on this heading, then move into the table above. |
| 105 | + |
| 106 | +--- |
| 107 | + |
| 108 | +## 8 — Tables inside blockquotes render fully |
| 109 | + |
| 110 | +The table inside this blockquote should render the separator row AND all |
| 111 | +data rows — not just the header. |
| 112 | + |
| 113 | +> | Name | Value | |
| 114 | +> |------|-------| |
| 115 | +> | alpha | 1 | |
| 116 | +> | beta | 2 | |
| 117 | +> | gamma | 3 | |
| 118 | +
|
| 119 | +Nested blockquote: |
| 120 | + |
| 121 | +> > | X | Y | |
| 122 | +> > |---|---| |
| 123 | +> > | a | b | |
| 124 | +
|
| 125 | +--- |
| 126 | + |
| 127 | +## 9 — Simple table renders correctly (nowrap) |
| 128 | + |
| 129 | +Set `nowrap`. This simple table should render with proper borders. |
| 130 | + |
| 131 | +| One | |
| 132 | +|-----| |
| 133 | +| 1 | |
| 134 | + |
| 135 | +And a wider one: |
| 136 | + |
| 137 | +| Col A | Col B | Col C | Col D | |
| 138 | +|-------|-------|-------|-------| |
| 139 | +| foo | bar | baz | qux | |
| 140 | +| alpha | beta | gamma | delta | |
| 141 | + |
| 142 | +--- |
| 143 | + |
| 144 | +## 10 — Alignment markers render correctly |
| 145 | + |
| 146 | +Each column should show the correct alignment decoration in the separator row. |
| 147 | + |
| 148 | +| Default | Left | Center | Right | |
| 149 | +|---------|:-----|:------:|------:| |
| 150 | +| none | left | center | right | |
| 151 | +| aaa | bbb | ccc | ddd | |
| 152 | + |
| 153 | +--- |
| 154 | + |
| 155 | +## 11 — Blockquote borders alongside table borders |
| 156 | + |
| 157 | +Both the blockquote border (`▋`) and table borders (`│`) should be visible |
| 158 | +side by side. |
| 159 | + |
| 160 | +> | Animal | Sound | |
| 161 | +> |--------|-------| |
| 162 | +> | Cat | Meow | |
| 163 | +> | Dog | Woof | |
| 164 | +
|
| 165 | +--- |
| 166 | + |
| 167 | +## 12 — Hybrid mode: cursor-line un-renders/re-renders cleanly |
| 168 | + |
| 169 | +Move your cursor row-by-row through this table. Each row should un-render |
| 170 | +when the cursor is on it (showing raw markdown) and re-render when the |
| 171 | +cursor leaves. |
| 172 | + |
| 173 | +| Language | Typing | Speed | |
| 174 | +|----------|--------|-------| |
| 175 | +| Lua | dynamic | fast | |
| 176 | +| Rust | static | fast | |
| 177 | +| Python | dynamic | moderate | |
| 178 | +| C | static | very fast | |
| 179 | + |
| 180 | +--- |
| 181 | + |
| 182 | +## 13 — Code blocks inside lists render correctly |
| 183 | + |
| 184 | +The code block below is nested inside a list. It should render with proper |
| 185 | +syntax highlighting and code-block decorations. |
| 186 | + |
| 187 | +1. **First item** |
| 188 | + - Sub-item with code: |
| 189 | + |
| 190 | + ```lua |
| 191 | + local M = {} |
| 192 | + function M.setup(opts) |
| 193 | + return vim.tbl_deep_extend("force", {}, opts or {}) |
| 194 | + end |
| 195 | + return M |
| 196 | + ``` |
| 197 | + |
| 198 | + - Another sub-item |
| 199 | + |
| 200 | +2. **Second item** |
| 201 | + |
| 202 | +--- |
| 203 | + |
| 204 | +## 14 — Headings, horizontal rules, inline formatting unaffected |
| 205 | + |
| 206 | +### This is an H3 |
| 207 | + |
| 208 | +#### This is an H4 |
| 209 | + |
| 210 | +##### This is an H5 |
| 211 | + |
| 212 | +--- |
| 213 | + |
| 214 | +Inline formatting: **bold**, *italic*, ***bold-italic***, `inline code`, |
| 215 | +~~strikethrough~~, and [a link](https://example.com). |
| 216 | + |
| 217 | +A horizontal rule below: |
| 218 | + |
| 219 | +--- |
| 220 | + |
| 221 | +And another: |
| 222 | + |
| 223 | +*** |
| 224 | + |
| 225 | +--- |
| 226 | + |
| 227 | +## End of regression examples |
| 228 | + |
| 229 | +Replace ☐ with ✅ or ❌ in `test/regression-matrix.md` as you test each case. |
0 commit comments