Skip to content

Incorrectly parses p tag with a nested strong tag #3

@andyg2

Description

@andyg2

I've found a small problem with text nodes and converter.py
Supplying the html...

<div>
   <p>hello <strong>bold</strong> goodbye</p>
</div>

Returns:

{
    "content": {
        "content": [
            {
                "text": "hello "
            },
            {
                "content": [
                    {
                        "text": "bold"
                    },
                    {
                        "text": " goodbye"
                    }
                ],
                "type": "strong"
            }
        ],
        "type": "p"
    }
}

Which reconstructs as:

<div>
   <p>hello <strong>bold goodbye</strong></p>
</div>

I think it should return:

{
    "content": {
        "content": [
            {
                "content": [
                    {
                        "text": "hello"
                    }
                ],
                "content": [
                    {
                        "text": "bold"
                    },
                    "type": "strong"
                ],
                "content": [
                    {
                        "text": " goodbye"
                    }
                ]
            }
        ],
        "type": "p"
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions