Skip to content

Foot notes appear repeated #53

@rliberoff

Description

@rliberoff

Hello!

I'm using the latest version, and for the following markdown:

The key to succeeding in Asia-Pacific is to strongly engage with Chinese passengers both domestically in China and internationally in neighboring countries such as Thailand, South Korea, and Japan. 
The company already has a solid footprint in this area and plans to further expand in existing and new locations.^[https://stkaitorag7d628.blob.core.windows.net/user-documents/user-documents/r_oyorimfisd/Internal.pdf?sv=2024-05-04&se=2024-07-19T11%3A53%3A56Z&sr=b&sp=r&sig=v3wZ%2FmS8pdn%2BDyEORunEROP6IubKgIxSrmieb5gWfdM%3D]

I'm getting the following render:

<p>
    The key to succeed in Asia-Pacific is to strongly engage with Chinese passengers domestically in China and when they travel internationally to neighboring countries such as Thailand, South Korea and Japan. The company already has a solid footprint in
    this geographic area and plans to further expand in existing and new locations.<sup class="footnote-ref"><a href="#fn2" id="fnref2">[2]</a></sup>
</p>
<hr class="footnotes-sep" />
<section class="footnotes">
    <ol class="footnotes-list">
        <li id="fn1" class="footnote-item">
            <p>
                https://stkaitorag7d628.blob.core.windows.net/user-documents/user-documents/r_f16m2hh9sm/Indernal.pdf?sv=2024-05-04&amp;se=2024-07-19T12%3A00%3A51Z&amp;sr=b&amp;sp=r&amp;sig=6DZ9SG10Ee4NDn7yS2aUbwZdWNyZOfBakhy3%2F8ly0qo%3D
                <a href="#fnref1" class="footnote-backref">↩︎</a>
            </p>
        </li>
        <li id="fn2" class="footnote-item">
            <p>
                https://stkaitorag7d628.blob.core.windows.net/user-documents/user-documents/r_f16m2hh9sm/Indernal.pdf?sv=2024-05-04&amp;se=2024-07-19T12%3A00%3A51Z&amp;sr=b&amp;sp=r&amp;sig=6DZ9SG10Ee4NDn7yS2aUbwZdWNyZOfBakhy3%2F8ly0qo%3D
                <a href="#fnref2" class="footnote-backref">↩︎</a>
            </p>
        </li>
    </ol>
</section>

As you can see... I'm getting the footnotes repeated. The expected behavior is just one footnote with the correct number.

This is the code in Javascript:

```html
<script crossorigin="anonymous" src="https://cdn.jsdelivr.net/npm/[email protected]/dist/markdown-it.min.js"></script>
<script crossorigin="anonymous" src="https://cdn.jsdelivr.net/npm/[email protected]/dist/markdown-it-for-inline.min.js"></script>
<script crossorigin="anonymous" src="https://cdn.jsdelivr.net/npm/[email protected]/dist/markdown-it-footnote.min.js"></script>
<script crossorigin="anonymous" src="https://cdn.botframework.com/botframework-webchat/latest/webchat.js"></script>

//...

<script>
    (async function () {
    // ...
     const iterarator = markdownitForInline;

     const markdownIt = window.markdownit()
                          .use(markdownitFootnote)
                          .use(iterarator, 'url_new_win', 'link_open', function (tokens, idx) {
                              let aIndex = tokens[idx].attrIndex('target');

                              if (aIndex < 0) {
                                  tokens[idx].attrPush(['target', '_blank']);
                              } else {
                                  tokens[idx].attrs[aIndex][1] = '_blank';
                              }
                          })
                          ;
    //...    
})().catch(err => console.error(err));
</script>

Please help!

Metadata

Metadata

Assignees

No one assigned

    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