Skip to content

Commit 2a7cf94

Browse files
committed
fix(remark): updated table normalization
1 parent 5be8459 commit 2a7cf94

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

packages/typedoc-plugin-remark/src/normalize-tables.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export default function () {
99
this.compiler = (tree) => {
1010
let content = compiler(tree);
1111
content = content
12-
.replace(/^\s*(<\/?(table|tr|th|td)>)/gm, (match, p1) => p1)
12+
.replace(/^\s*(<\/?(table|thead|tbody|tr|th|td)>)/gm, (match, p1) => p1)
1313
.replace(
1414
/<td>\s*([\s\S]*?)\s*<\/td>/gm,
1515
(match, p1) =>

packages/typedoc-plugin-remark/test/specs/__snapshots__/remark.spec.ts.snap

+24
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,14 @@ exports[`Remark should parse globals page 1`] = `
2525
#### Parameters
2626
2727
<table>
28+
<thead>
2829
<tr>
2930
<th>Parameter</th>
3031
<th>Type</th>
3132
<th>Description</th>
3233
</tr>
34+
</thead>
35+
<tbody>
3336
<tr>
3437
<td>
3538
@@ -51,6 +54,7 @@ const x = 1;
5154
5255
</td>
5356
</tr>
57+
</tbody>
5458
</table>
5559
5660
#### Returns
@@ -77,11 +81,14 @@ exports[`Remark should parse globals page without toc 1`] = `
7781
#### Parameters
7882
7983
<table>
84+
<thead>
8085
<tr>
8186
<th>Parameter</th>
8287
<th>Type</th>
8388
<th>Description</th>
8489
</tr>
90+
</thead>
91+
<tbody>
8592
<tr>
8693
<td>
8794
@@ -103,6 +110,7 @@ const x = 1;
103110
104111
</td>
105112
</tr>
113+
</tbody>
106114
</table>
107115
108116
#### Returns
@@ -131,16 +139,20 @@ title: 'test'
131139
## Type Parameters
132140
133141
<table>
142+
<thead>
134143
<tr>
135144
<th>Type Parameter</th>
136145
</tr>
146+
</thead>
147+
<tbody>
137148
<tr>
138149
<td>
139150
140151
\`T\`
141152
142153
</td>
143154
</tr>
155+
</tbody>
144156
</table>
145157
146158
## Constructors
@@ -262,16 +274,20 @@ javascript
262274
263275
#### Type Parameters
264276
<table>
277+
<thead>
265278
<tr>
266279
<th>Type Parameter</th>
267280
</tr>
281+
</thead>
282+
<tbody>
268283
<tr>
269284
<td>
270285
271286
\`T\`
272287
273288
</td>
274289
</tr>
290+
</tbody>
275291
</table>
276292
277293
#### Constructors
@@ -296,16 +312,20 @@ javascript
296312
297313
#### Type Parameters
298314
<table>
315+
<thead>
299316
<tr>
300317
<th>Type Parameter</th>
301318
</tr>
319+
</thead>
320+
<tbody>
302321
<tr>
303322
<td>
304323
305324
\`T\`
306325
307326
</td>
308327
</tr>
328+
</tbody>
309329
</table>
310330
311331
#### Properties
@@ -336,10 +356,13 @@ javascript
336356
337357
#### Parameters
338358
<table>
359+
<thead>
339360
<tr>
340361
<th>Parameter</th>
341362
<th>Type</th>
342363
</tr>
364+
</thead>
365+
<tbody>
343366
<tr>
344367
<td>
345368
@@ -352,6 +375,7 @@ javascript
352375
353376
</td>
354377
</tr>
378+
</tbody>
355379
</table>
356380
357381
#### Returns

0 commit comments

Comments
 (0)