Skip to content

Wrong footnote order when footnote in list or quote #178

Open

Description

@fladd

When a footnote is in a list or quote, it seems to be processed before other footnotes, leading to this footnote being footnote number 1, even when it is actually not the first one.

Activity

  1. Noah-A commented on Apr 28, 2015

    @Noah-A

    This is also a really big issue for me.

  2. nosas commented on Jan 16, 2022

    @nosas

    Bringing this issue up again after nearly 7 years. Reproduction is fairly easy.

    Below is a sample markdown input using a paragraph and table along with the respective HTML output.

    Moreover, the best strategy does not necessarily allow one to win but will minimize the losses[^1].
    
    ## Minimax vocabulary
    
    | **Keyword**       | **Variable**   | **Definition** |
    | --------------    | -------------- | -------------- |
    | Player/Maximizer  | p<sub>max</sub>[^2]| Maximizes their action's value and minimizes the maximum loss in a worst-case scenario. |
    
    # References/Notes
    
    [^1]: [Stanford CS, Game Theory: Zero-Sum Games](https://cs.stanford.edu/people/eroberts/courses/soco/projects/1998-99/game-theory/zero.html)
    [^2]: Other papers or articles may refer to the player as p<sub>i</sub> or a<sub>i</sub>, and opponent(s) as p<sub>-i</sub> or a<sub>-i</sub>

    The respective HTML output:

    Moreover, the best strategy does not necessarily allow one to win but will minimize the losses<sup class="footnote-ref" id="fnref-1"><a href="#fn-1">2</a></sup>.</p>
    
      <h2 id="minimax-vocabulary">Minimax vocabulary</h2>
    
      <table>
        <thead>
          <tr>
            <th><strong>Keyword</strong></th>
            <th><strong>Variable</strong></th>
            <th><strong>Definition</strong></th>
          </tr>
        </thead>
        <tbody>
          <tr>
            <td>Player/Maximizer</td>
            <td>p<sub>max</sub><sup class="footnote-ref" id="fnref-2"><a href="#fn-2">1</a></sup></td>
            <td>Maximizes their action's value and minimizes the maximum loss in a worst-case scenario.</td>
          </tr>
        </tbody>
      </table>
    
      <h1 id="referencesnotes">References/Notes</h1>
    
      <div class="footnotes">
        <hr />
        <ol>
          <li id="fn-2">
            <p>Other papers or articles may refer to the player as p<sub>i</sub> or a<sub>i</sub>, and opponent(s) as
              p<sub>-i</sub> or a<sub>-i</sub>&#160;<a href="#fnref-2" class="footnoteBackLink"
                title="Jump back to footnote 1 in the text.">&#8617;</a></p>
          </li>
    
          <li id="fn-1">
            <p><a
                href="https://cs.stanford.edu/people/eroberts/courses/soco/projects/1998-99/game-theory/zero.html">Stanford
                CS, Game Theory: Zero-Sum Games</a>&#160;<a href="#fnref-1" class="footnoteBackLink"
                title="Jump back to footnote 2 in the text.">&#8617;</a></p>
          </li>
        </ol>
      </div>

    If the sample above is not clear, the first footnote should be the reference to the Stanford course; however, the parser prioritizes the reference in the markdown table.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions