@khanacademy/perseus-core 42.5.1 → 42.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1 -0
- package/dist/index.js +17 -2
- package/dist/index.js.map +1 -1
- package/dist/utils/table-row-headers.d.ts +20 -0
- package/package.json +1 -1
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
type MarkdownNode = {
|
|
2
|
+
type: string;
|
|
3
|
+
[key: string]: any;
|
|
4
|
+
};
|
|
5
|
+
type TableCell = ReadonlyArray<MarkdownNode>;
|
|
6
|
+
export declare function isEmptyTableCell(cell: TableCell): boolean;
|
|
7
|
+
export declare function isBoldTableCell(cell: TableCell): boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Markdown has no syntax for row headers, so we infer them from two common
|
|
10
|
+
* authoring patterns:
|
|
11
|
+
*
|
|
12
|
+
* 1. The first column header is empty.
|
|
13
|
+
* Or
|
|
14
|
+
* 2. Every body cell in the first column is bold.
|
|
15
|
+
*
|
|
16
|
+
* Tables with a single column are never treated as having row headers, as
|
|
17
|
+
* there would be no data cells for the headers to describe.
|
|
18
|
+
*/
|
|
19
|
+
export declare function tableHasRowHeaders(node: MarkdownNode): boolean;
|
|
20
|
+
export {};
|