Skip to content

blocksToMarkdown() drops sublist items in a column #96

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
andrew-polk opened this issue Aug 15, 2023 · 2 comments
Closed

blocksToMarkdown() drops sublist items in a column #96

andrew-polk opened this issue Aug 15, 2023 · 2 comments

Comments

@andrew-polk
Copy link

andrew-polk commented Aug 15, 2023

Steps:

  • In Notion, create two columns.
  • In the first column, create a numbered list.
  • In the numbered list, create a sublist item.
    image

The column_list block will look like

{
  "object": "block",
  "id": "5fcf1c58-3ddf-495c-a2c4-22376bcab1fd",
...
  "has_children": true,
  "archived": false,
  "type": "column_list",
  "column_list": {}
}

but the result of blocksToMarkdown() is

{ type: 'column_list', parent: '1. Column One\n\n', children: [] }

and subsequently, toMarkdownString() gives

1. Column One

The sublist item is missing completely.



Further detail showing that the blocks are correct coming from the Notion API:
column:

{
      "object": "block",
      "id": "e6d2d7b7-b1ed-464a-86d2-bb5f6be78a03",
      "parent": {
        "type": "block_id",
        "block_id": "5fcf1c58-3ddf-495c-a2c4-22376bcab1fd"
      },
...
      "has_children": true,
      "archived": false,
      "type": "column",
      "column": {}
    }

numbered_list_item:

{
      "object": "block",
      "id": "ef7a9a98-0a6a-4df0-a790-aec9ab29d55a",
      "parent": {
        "type": "block_id",
        "block_id": "e6d2d7b7-b1ed-464a-86d2-bb5f6be78a03"
      },
...
      "has_children": true,
      "archived": false,
      "type": "numbered_list_item",
      "numbered_list_item": {
        "rich_text": [
          {
            "type": "text",
            "text": { "content": "Column One", "link": null },
            "annotations": {
              "bold": false,
              "italic": false,
              "strikethrough": false,
              "underline": false,
              "code": false,
              "color": "default"
            },
            "plain_text": "Column One",
            "href": null
          }
        ],
        "color": "default"
      }
    }

bulleted_list_item:

{
      "object": "block",
      "id": "c0fe4b1b-4803-43b1-8454-8ecff8babe9d",
      "parent": {
        "type": "block_id",
        "block_id": "ef7a9a98-0a6a-4df0-a790-aec9ab29d55a"
      },
...
      "has_children": false,
      "archived": false,
      "type": "bulleted_list_item",
      "bulleted_list_item": {
        "rich_text": [
          {
            "type": "text",
            "text": { "content": "missing bullet", "link": null },
            "annotations": {
              "bold": false,
              "italic": false,
              "strikethrough": false,
              "underline": false,
              "code": false,
              "color": "default"
            },
            "plain_text": "missing bullet",
            "href": null
          }
        ],
        "color": "default"
      }
    }
@andrew-polk
Copy link
Author

andrew-polk commented Aug 24, 2023

This may be fixed in 3.1.1. (I was on 2.5.5.)
Investigating.

@andrew-polk
Copy link
Author

andrew-polk commented Aug 25, 2023

Yes, this does seem to work in 3.1.1 so long as you don't have custom transformers (see #98).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant