@sebastienheyd/clickup-mcp 1.8.0 → 1.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/clickup-text.js +17 -0
- package/package.json +1 -1
package/dist/clickup-text.js
CHANGED
|
@@ -639,7 +639,24 @@ function walkMdastNodes(nodes, inheritedAttrs, blocks, depth = 0, attachmentsByS
|
|
|
639
639
|
}
|
|
640
640
|
break;
|
|
641
641
|
}
|
|
642
|
+
// Keep the blank line the source puts between two blocks: remark drops it, and
|
|
643
|
+
// ClickUp would otherwise glue paragraphs and lists into one dense block
|
|
644
|
+
if (hasBlankLineBefore(nodes[i + 1], node)) {
|
|
645
|
+
blocks.push({ text: '\n', attributes: {} });
|
|
646
|
+
}
|
|
647
|
+
}
|
|
648
|
+
}
|
|
649
|
+
/**
|
|
650
|
+
* Whether the source has at least one blank line between `previous` and `next`.
|
|
651
|
+
* Several blank lines count as one, as in rendered markdown.
|
|
652
|
+
*/
|
|
653
|
+
function hasBlankLineBefore(next, previous) {
|
|
654
|
+
const previousEnd = previous.position?.end.line;
|
|
655
|
+
const nextStart = next?.position?.start.line;
|
|
656
|
+
if (previousEnd === undefined || nextStart === undefined) {
|
|
657
|
+
return false;
|
|
642
658
|
}
|
|
659
|
+
return nextStart - previousEnd > 1;
|
|
643
660
|
}
|
|
644
661
|
/**
|
|
645
662
|
* Recursively walk phrasing content (inline nodes) and build ClickUp blocks
|
package/package.json
CHANGED