Skip to content

Full reference links should have a fallback #20

Closed
@rubys

Description

Background: I'm converting node.js from marked to unified/remark/rehype, and found a regression. It seems that mdast-util-to-hast intentionally does not have a fallback for link references:

t.deepEqual(
to(
u(
'linkReference',
{
identifier: 'delta',
referenceType: 'full'
},
[u('text', 'echo')]
)
),
u(
'element',
{
tagName: 'a',
properties: {
href: ''
}
},
[u('text', 'echo')]
),
'should not fall back on full `linkReference`s'
)

This varies from the commonmark spec and other implementations:

https://spec.commonmark.org/0.28/#full-reference-link
https://spec.commonmark.org/dingus/?text=[foo][bar]

Is there a reason for this deviation?

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