Skip to content

MarkdownToBlocks method does not respect children/indentation #249

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
gpawlik-cais opened this issue Jun 19, 2023 · 0 comments
Closed

MarkdownToBlocks method does not respect children/indentation #249

gpawlik-cais opened this issue Jun 19, 2023 · 0 comments
Assignees
Labels
bug Something isn't working enhancement New feature or request prio:mid Medium priority

Comments

@gpawlik-cais
Copy link

gpawlik-cais commented Jun 19, 2023

When using markdownToBlocks the markdown indentation does not get reflected in the block "children" logic.

Example:

The following block:

[
    {
        "id": "ef853295-efd9-4511-ac0d-c45fe3b35310",
        "type": "bulletListItem",
        "props": {
            "textColor": "default",
            "backgroundColor": "default",
            "textAlignment": "left"
        },
        "content": [
            {
                "type": "text",
                "text": "Bullet point",
                "styles": {}
            }
        ],
        "children": [
            {
                "id": "7d4ca371-4642-4d23-a176-0f39d31b6745",
                "type": "bulletListItem",
                "props": {
                    "textColor": "default",
                    "backgroundColor": "default",
                    "textAlignment": "left"
                },
                "content": [
                    {
                        "type": "text",
                        "text": "Nested bullet point",
                        "styles": {}
                    }
                ],
                "children": []
            }
        ]
    },
]

When passed through the blocksToMarkdown function returns correctly the following markdown:

*   Bullet point

    *   Nested bullet point

However when trying to convert the markdown above back to blocks using markdownToBlocks function, it returns the following object:

[
    {
        "id": "d781e08d-6d5a-4107-9c5a-f1271e2343c2",
        "type": "bulletListItem",
        "props": {
            "textColor": "default",
            "backgroundColor": "default",
            "textAlignment": "left"
        },
        "content": [
            {
                "type": "text",
                "text": "Bullet point",
                "styles": {}
            }
        ],
        "children": []
    },
    {
        "id": "cd4962df-a040-46ae-9f4d-3b2480311ef7",
        "type": "bulletListItem",
        "props": {
            "textColor": "default",
            "backgroundColor": "default",
            "textAlignment": "left"
        },
        "content": [
            {
                "type": "text",
                "text": "Nested bullet point",
                "styles": {}
            }
        ],
        "children": []
    }
]
@gpawlik-cais gpawlik-cais added the enhancement New feature or request label Jun 19, 2023
@gpawlik-cais gpawlik-cais changed the title Expose markdownToBlocks method MarkdownToBlocks method does not respect children/indentation Jun 19, 2023
@YousefED YousefED added the bug Something isn't working label Jun 20, 2023
@matthewlipski matthewlipski added the prio:mid Medium priority label Jul 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request prio:mid Medium priority
Projects
None yet
Development

No branches or pull requests

3 participants