nooon 0.8.0 → 0.8.1
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.js +21 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -30534,10 +30534,29 @@ ${children}`;
|
|
|
30534
30534
|
}
|
|
30535
30535
|
return result;
|
|
30536
30536
|
}
|
|
30537
|
+
var LIST_BLOCK_TYPES = new Set([
|
|
30538
|
+
"bulleted_list_item",
|
|
30539
|
+
"numbered_list_item",
|
|
30540
|
+
"to_do",
|
|
30541
|
+
"toggle"
|
|
30542
|
+
]);
|
|
30537
30543
|
function blocksToMarkdown(blocks) {
|
|
30538
|
-
|
|
30544
|
+
if (blocks.length === 0)
|
|
30545
|
+
return "";
|
|
30546
|
+
const parts = [];
|
|
30547
|
+
for (let i = 0;i < blocks.length; i++) {
|
|
30548
|
+
if (i > 0) {
|
|
30549
|
+
const prev = blocks[i - 1];
|
|
30550
|
+
const curr = blocks[i];
|
|
30551
|
+
const sep = LIST_BLOCK_TYPES.has(prev.type) && LIST_BLOCK_TYPES.has(curr.type) ? `
|
|
30552
|
+
` : `
|
|
30539
30553
|
|
|
30540
|
-
|
|
30554
|
+
`;
|
|
30555
|
+
parts.push(sep);
|
|
30556
|
+
}
|
|
30557
|
+
parts.push(blockToMarkdown(blocks[i]));
|
|
30558
|
+
}
|
|
30559
|
+
return parts.join("");
|
|
30541
30560
|
}
|
|
30542
30561
|
function propertyValueToYaml(value, indent = "") {
|
|
30543
30562
|
if (value === null)
|