gomarkdown / markdown

markdown parser and HTML renderer for Go
Other
1.36k stars 171 forks source link

Parsing error when parsing nested bold+ital #279

Open ShadiestGoat opened 1 year ago

ShadiestGoat commented 1 year ago

I want to parse the following text: **bold *ital***, expecting bold ital, but I'm getting bold *ital*.

This is caused by close the strong tag on the first instance of 2 *s, even though there is an open ital tag *.

what its being parsed as now:

[
    {
        "content": "bold *ital",
        "type": "bold"
    },
    {
        "content": "*",
        "type": "text"
    }
]

what it should be parsed as:

[
    {
        "type": "bold",
                "children": [
               {
             "content": "bold ",
             "type": "text"
               },
               {
             "content": "ital",
             "type": "ital"
               }
                ]
    }
]