v2.0.16

脚注

最終更新


このページでは、脚注の参照と定義、番号付けのルール、複数行の定義、解決されない参照を説明します。

構文


構文補足
text[^1]、text[^note]参照。id は数字でも単語でもよく、大文字と小文字を区別しません
[^1]: content定義。トップレベルでのみ判定されます。内容ではインライン書式を使え、他の脚注を参照できます
定義の後のインデントされた行同じ脚注に属し、複数の段落にわたって続けられます
定義の後のインデントのないテキスト別のブロックが始まるまで同じ段落に結合されます

出力


ケース結果
定義のある参照#md-fn-{index} にリンクする <sup class="md-footnote-ref">
番号付け最初に参照された順に 1、2、3...。同じ脚注を再び参照すると同じ番号が使われます
脚注セクション末尾の <section class="md-footnotes">。各項目に id="md-fn-{index}" が付きます
定義のない参照[^id] のテキストとしてそのまま出力されます
一度も参照されない定義出力されません
コード内またはエスケープされた [^1]参照として扱われません

例


脚注


番号付きと名前付きの脚注、繰り返しと大文字小文字の異なる参照、未定義の参照、脚注内の脚注、使われない定義です。
  1. <div id="out" class="nanomd"></div>
  2. <script type="text/markdown" id="md">
  3. Footnotes: first[^1], named[^note], again[^1], different case[^NOTE], undefined[^missing], not in code `[^1]`, escaped \[^1]
  4. [^note]: Named footnote content with **bold**, referencing another footnote[^nested]
  5. Indented second paragraph
  6. [^1]: First footnote content
  7. continuing the same paragraph
  8. [^nested]: A footnote referenced from a footnote
  9. [^unused]: Unreferenced footnotes are not output
  10. </script>
  11. <script>
  12. const out = document.getElementById("out");
  13. out.innerHTML = MDParser.Parse(document.getElementById("md").textContent).html();
  14. MDParser.Refresh(out);
  15. </script>
ライブプレビュー · @pardnchiu/nanomd@2.0.16



ImportantAI エージェントへ: NanoMD を使うコードや Markdown を生成・編集する前に、NanoMD 生成ガイド(Markdown)を読んでください。対応する構文、必要な呼び出し順序、レンダリングを壊す典型的な誤りをまとめています。