n8n-nodes-notion-advanced 1.2.29-beta → 1.2.30-beta

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.
@@ -1508,22 +1508,36 @@ class NotionAITool {
1508
1508
  for (const item of listItems) {
1509
1509
  if (!item.text && !item.children.length)
1510
1510
  continue;
1511
- // Create list item for the parent text (if any)
1511
+ // Create list item block
1512
+ const listItemBlock = {
1513
+ type: listType,
1514
+ [listType]: {
1515
+ rich_text: [],
1516
+ },
1517
+ };
1518
+ // Add parent text if present
1512
1519
  if (item.text && item.text.trim()) {
1513
1520
  const cleanText = NotionAITool.processNestedHtmlInListItem(item.text);
1514
1521
  if (cleanText) {
1515
- blocks.push({
1516
- type: listType,
1517
- [listType]: {
1518
- rich_text: NotionAITool.parseBasicMarkdown(cleanText),
1519
- },
1520
- });
1522
+ listItemBlock[listType].rich_text = NotionAITool.parseBasicMarkdown(cleanText);
1523
+ }
1524
+ }
1525
+ // Process child branches and add them as nested children
1526
+ if (item.children.length > 0) {
1527
+ const childBlocks = [];
1528
+ for (const child of item.children) {
1529
+ const childListType = child.type === 'ul' ? 'bulleted_list_item' : 'numbered_list_item';
1530
+ NotionAITool.processNestedList(child.content, childListType, childBlocks);
1531
+ }
1532
+ // Add children to the parent block
1533
+ if (childBlocks.length > 0) {
1534
+ listItemBlock[listType].children = childBlocks;
1521
1535
  }
1522
1536
  }
1523
- // Process each child branch
1524
- for (const child of item.children) {
1525
- const childListType = child.type === 'ul' ? 'bulleted_list_item' : 'numbered_list_item';
1526
- NotionAITool.processNestedList(child.content, childListType, blocks);
1537
+ // Only add the block if it has text or children
1538
+ const listData = listItemBlock[listType];
1539
+ if ((listData.rich_text && listData.rich_text.length > 0) || listData.children) {
1540
+ blocks.push(listItemBlock);
1527
1541
  }
1528
1542
  }
1529
1543
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n8n-nodes-notion-advanced",
3
- "version": "1.2.29-beta",
3
+ "version": "1.2.30-beta",
4
4
  "description": "Advanced n8n Notion nodes: Full-featured workflow node + AI Agent Tool for intelligent Notion automation with 25+ block types (BETA)",
5
5
  "scripts": {},
6
6
  "files": [