Skip to content

Commit ebf07d9

Browse files
authored
Merge pull request sveltejs#9 from sveltejs/tables
feat: support gfm tables
2 parents e2c5574 + 84be401 commit ebf07d9

File tree

7 files changed

+190
-22
lines changed

7 files changed

+190
-22
lines changed

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,13 @@
5757
"unist-builder": "^2.0.3",
5858
"unist-util-visit": "^2.0.3",
5959
"uvu": "^0.5.1",
60-
"vfile": "^4.2.1",
60+
"vfile": "4",
6161
"vfile-message": "^2.0.4"
6262
},
6363
"dependencies": {
6464
"@actions/github": "^4.0.0",
6565
"@polka/send": "^1.0.0-next.12",
66-
"httpie": "^1.1.2"
66+
"httpie": "^1.1.2",
67+
"remark-gfm": "1"
6768
}
6869
}

pnpm-lock.yaml

Lines changed: 140 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/format/format_api.test.ts

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,42 @@ console.log('boo')
5353
// console.log(x);
5454
});
5555

56+
_format("formats", async () => {
57+
const md = `### Table
58+
59+
| Branch | Commit |
60+
| ------- | ---------------- |
61+
| main | 0123456789abcdef |
62+
| staging | fedcba9876543210 |`;
63+
64+
const x = await format({
65+
file: "boo.md",
66+
markdown: md,
67+
project: "svelte",
68+
docs_type: "docs",
69+
dir: "docs/boo",
70+
level: 3,
71+
});
72+
73+
assert.equal(x.contents, `<h3 id="false-table">Table</h3>
74+
<table>
75+
<thead>
76+
<tr>
77+
<th>Branch</th>
78+
<th>Commit</th>
79+
</tr>
80+
</thead>
81+
<tbody>
82+
<tr>
83+
<td>main</td>
84+
<td>0123456789abcdef</td>
85+
</tr>
86+
<tr>
87+
<td>staging</td>
88+
<td>fedcba9876543210</td>
89+
</tr>
90+
</tbody>
91+
</table>`);
92+
});
93+
5694
_format.run();

0 commit comments

Comments
 (0)