tellegram 1.1.16 → 1.1.18
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/README.md +6 -6
- package/lib/table-to-list.mjs +4 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -135,13 +135,13 @@ const markdown = `
|
|
|
135
135
|
|
|
136
136
|
convert(markdown, 'escape');
|
|
137
137
|
/*
|
|
138
|
-
1\.
|
|
139
|
-
|
|
140
|
-
|
|
138
|
+
1\. Name: Alice
|
|
139
|
+
• Role: Admin
|
|
140
|
+
• Score: 95
|
|
141
141
|
|
|
142
|
-
2\.
|
|
143
|
-
|
|
144
|
-
|
|
142
|
+
2\. Name: Bob
|
|
143
|
+
• Role: User
|
|
144
|
+
• Score: 88
|
|
145
145
|
*/
|
|
146
146
|
```
|
|
147
147
|
|
package/lib/table-to-list.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import phrasing from 'mdast-util-to-markdown/lib/util/container-phrasing.js';
|
|
|
3
3
|
import { escapeSymbols } from './utils.mjs';
|
|
4
4
|
|
|
5
5
|
const EMPTY_VALUE = escapeSymbols('-');
|
|
6
|
-
const FALLBACK_HEADER = escapeSymbols('-');
|
|
6
|
+
const FALLBACK_HEADER = escapeSymbols('- ');
|
|
7
7
|
|
|
8
8
|
const normalizeCell = (node, context) => {
|
|
9
9
|
if (!node) {
|
|
@@ -26,10 +26,10 @@ const normalizeValue = (cell, context) => {
|
|
|
26
26
|
|
|
27
27
|
const pairToLine = (pair, rowIndex, isNested) => {
|
|
28
28
|
if (isNested) {
|
|
29
|
-
return
|
|
29
|
+
return `• ${pair.header}: ${pair.value}`;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
return `${rowIndex + 1}\\.
|
|
32
|
+
return `${rowIndex + 1}\\. ${pair.header}: ${pair.value}`;
|
|
33
33
|
};
|
|
34
34
|
|
|
35
35
|
export default (node, context) => {
|
|
@@ -55,7 +55,7 @@ export default (node, context) => {
|
|
|
55
55
|
});
|
|
56
56
|
|
|
57
57
|
if (!pairs.length) {
|
|
58
|
-
return `${rowIndex + 1}\\.
|
|
58
|
+
return `${rowIndex + 1}\\. Item ${rowIndex + 1}: ${EMPTY_VALUE}`;
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
const [first, ...rest] = pairs;
|