MarkBind / markbind

MarkBind is a tool for generating content-heavy websites from source files in Markdown format
https://markbind.org/
MIT License
135 stars 124 forks source link

Footnote numbered wrongly when importing footnote with include #2430

Open yiwen101 opened 7 months ago

yiwen101 commented 7 months ago

Please confirm that you have searched existing issues in the repo

Yes, I have searched the existing issues

Any related issues?

2203

Tell us about your environment

macOS

MarkBind version

5.2.0

Describe the bug and the steps to reproduce it

Adding this to "topic1.md"

## Footnotes

1 + 1 = 2 ^[Math1]
<div id="examples" class="d-none">

1 + 1 = 2 ^[Math2]
</div>

third test^[last footnote]

Add this to index.md:


footnote1^[first footnote]

<include src = "./topic1.md"></include>

We see:

Screenshot 2024-02-19 at 13 08 55

Expected behavior

1 footnotes that not visible to users are not rendered? 2 footnotes from include are properly indexed and displayed.

Anything else?

I feel it is reasonable to fix this first before fixing #2203, as otherwise we are forced to either: Add weak test case that do not take care of the id of the footnote or Add test case that expect to get footnote with wrong ids

Both ways are not ideal.