Skip to content

[CommonMark] Link mis-parsing when following a reference #324

@ikatyang

Description

@ikatyang

Subject of the issue

commonmark: true

[1][Test Text](http://example.com)

Steps to reproduce

astexplorer

Expected behaviour

Same as CommonMark playground:

[
    {
        "type": "text",
        "value": "["
    },
    {
        "type": "text",
        "value": "1"
    },
    {
        "type": "text",
        "value": "]"
    },
    {
        "type": "link",
        "title": null,
        "url": "http://example.com",
        "children": [
            {
            "type": "text",
            "value": "Test Text"
            }
        ]
    }
]

Actual behaviour

[
    {
        "type": "linkReference",
        "identifier": "test text",
        "referenceType": "full",
        "children": [
            {
                "type": "text",
                "value": "1"
            }
        ]
    },
    {
        "type": "text",
        "value": "("
    },
    {
        "type": "link",
        "title": null,
        "url": "http://example.com",
        "children": [
            {
                "type": "text",
                "value": "http://example.com"
            }
        ]
    },
    {
        "type": "text",
        "value": ")"
    }
]

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions