Skip to content

Footnote definition disappears if footnote is in a table nested in an admonition #22

@fabcor-maxiv

Description

@fabcor-maxiv

If a footnote is in a table which itself is nested in an admonition, mdformat (with mdformat-footnote extension) removes the footnote definition.

Before mdformat:

# Document

| Color |
| ------ |
| R [^1] |
| G [^2] |
| B [^3] |

```{tip}
| Color |
| ------ |
| C [^4] |
| M [^5] |
| Y [^6] |
```

[^1]: Red

[^2]: Green

[^3]: Blue

[^4]: Cyan

[^5]: Magenta

[^6]: Yellow

After mdformat:

# Document

| Color |
| ------ |
| R [^1] |
| G [^2] |
| B [^3] |

```{tip}
| Color |
| ------ |
| C [^4] |
| M [^5] |
| Y [^6] |
```

[^1]: Red

[^2]: Green

[^3]: Blue

Diff:

--- i/document.md
+++ w/document.md
@@ -19,9 +19,3 @@
 [^2]: Green
 
 [^3]: Blue
-
-[^4]: Cyan
-
-[^5]: Magenta
-
-[^6]: Yellow

Packages:

Package           Version
----------------- -------
markdown-it-py    4.0.0
mdformat          1.0.0
mdformat_footnote 0.1.2
mdit-py-plugins   0.5.0
mdurl             0.1.2
pip               24.3.1

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions