Skip to content

Footnotes in links are broken #249

@wooorm

Description

@wooorm
[a [^b] c](https://example.com)

[^b]: asd

Renders (formatted w/ whitespace):

<p dir="auto">
  <a href="https://example.com">
    a
    <sup></sup>
  </a>
  <a
    href="#user-content-fn-b"
    id="user-content-fnref-b"
    data-footnote-ref=""
    aria-describedby="footnote-label"
  >1</a>
  c
</p>

Rendered here:

a 1 c


Expected. Either (when not using HTML parsing to sanitize):

<p>
  <a href="https://example.com">
    a
    <sup>
      <a
        href="#user-content-fn-b"
        id="user-content-fnref-b"
        data-footnote-ref=""
        aria-describedby="footnote-label"
      >1</a>
    </sup>
    c
  </a>
</p>

Or (when not generating footnotes in certain disallowed tags):

<p>
  <a href="https://example.com">
    a [^b] c
  </a>
</p>

Footnotes

  1. asd

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions