Skip to content

[fuzz results] empty square brackets after footnote reference silently eaten #772

@notriddle

Description

@notriddle

This text:

[^foo][]

[^foo][baz]

[baz][^foo]

[^foo]: bar

[baz]: https://rust-lang.org

In pulldown-cmark, the empty square braces on the first line disappear, but GitHub, markdown-it, and commonmark-hs keep them:

1[]

^foo

[baz]1

Yes, footnote references are a lot like links, but not that much.

Details

Events from pulldown-cmark:

"[^+\\&~+][]\n[^+\\&~+]:\n" -> [
  Start(Paragraph)
    FootnoteReference(Boxed("1"))
    Start(FootnoteDefinition(Boxed("1")))
    End(FootnoteDefinition)
  End(Paragraph)
]

Events from pandoc:

"[^+\\&~+][]\n[^+\\&~+]:\n" -> [
  Start(Paragraph)
    FootnoteReference(Boxed("1"))
    Start(FootnoteDefinition(Boxed("1")))
    End(FootnoteDefinition)
    Text(Boxed("[]"))
  End(Paragraph)
]

Footnotes

  1. bar 2

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