1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220
|
## Footnotes
TODO: proper spec.
This test is based on the one from gfm.
```````````````````````````````` example
This is some text![^1]. Other text.[^footnote].
Here's a thing[^other-note].
And another thing[^codeblock-note].
This doesn't have a referent[^nope].
[^1]: Some *bolded* footnote definition.
[^footnote]:
> Blockquotes can be in a footnote.
as well as code blocks
or, naturally, simple paragraphs.
[^other-note]: no code block here (spaces are stripped away)
[^codeblock-note]:
this is now a code block (8 spaces indentation)
Hi!
[^unused]: This is unused.
.
<p>This is some text!<sup class="footnote-ref"><a href="#fn-1" id="fnref-1">1</a></sup>. Other text.<sup class="footnote-ref"><a href="#fn-footnote" id="fnref-footnote">2</a></sup>.</p>
<p>Here's a thing<sup class="footnote-ref"><a href="#fn-other-note" id="fnref-other-note">3</a></sup>.</p>
<p>And another thing<sup class="footnote-ref"><a href="#fn-codeblock-note" id="fnref-codeblock-note">4</a></sup>.</p>
<p>This doesn't have a referent[^nope].</p>
<p>Hi!</p>
<section class="footnotes">
<div class="footnote" id="fn-1">
<div class="footnote-number">
<a href="#fnref-1">1</a>
</div>
<div class="footnote-contents">
<p>Some <em>bolded</em> footnote definition.</p>
</div>
</div>
<div class="footnote" id="fn-footnote">
<div class="footnote-number">
<a href="#fnref-footnote">2</a>
</div>
<div class="footnote-contents">
<blockquote>
<p>Blockquotes can be in a footnote.</p>
</blockquote>
<pre><code>as well as code blocks
</code></pre>
<p>or, naturally, simple paragraphs.</p>
</div>
</div>
<div class="footnote" id="fn-other-note">
<div class="footnote-number">
<a href="#fnref-other-note">3</a>
</div>
<div class="footnote-contents">
<pre><code> no code block here (spaces are stripped away)
</code></pre>
</div>
</div>
<div class="footnote" id="fn-codeblock-note">
<div class="footnote-number">
<a href="#fnref-codeblock-note">4</a>
</div>
<div class="footnote-contents">
<pre><code>this is now a code block (8 spaces indentation)
</code></pre>
</div>
</div>
<div class="footnote" id="fn-unused">
<div class="footnote-number">
<a href="#fnref-unused">5</a>
</div>
<div class="footnote-contents">
<p>This is unused.</p>
</div>
</div>
</section>
````````````````````````````````
Ensure that nested blocks in footnotes are rendered in the
right order (#63).
```````````````````````````````` example
Hello[^test]
Footnote containing a list[^list]
[^test]:
> first
>
> second
>
> third
[^list]:
1. First element
1. Second element
.
<p>Hello<sup class="footnote-ref"><a href="#fn-test" id="fnref-test">1</a></sup></p>
<p>Footnote containing a list<sup class="footnote-ref"><a href="#fn-list" id="fnref-list">2</a></sup></p>
<section class="footnotes">
<div class="footnote" id="fn-test">
<div class="footnote-number">
<a href="#fnref-test">1</a>
</div>
<div class="footnote-contents">
<blockquote>
<p>first</p>
<p>second</p>
<p>third</p>
</blockquote>
</div>
</div>
<div class="footnote" id="fn-list">
<div class="footnote-number">
<a href="#fnref-list">2</a>
</div>
<div class="footnote-contents">
<ol>
<li>First element</li>
<li>Second element</li>
</ol>
</div>
</div>
</section>
````````````````````````````````
Footnote labels cannot be empty, or composed only of whitespace.
```````````````````````````````` example
Test [^] link [^ ]
[^]: https://haskell.org
.
<p>Test <a href="https://haskell.org">^</a> link <a href="https://haskell.org">^ </a></p>
````````````````````````````````
```````````````````````````````` example
[^]: not a footnote
[^ ]: not a footnote
[^
]: not a footnote
.
<p>[^]: not a footnote</p>
<p>[^ ]: not a footnote</p>
<p>[^
]: not a footnote</p>
````````````````````````````````
Footnote labels cannot contain line breaks, even where link labels can.
```````````````````````````````` example
[^foo\
bar]: not a footnote definition
[baz\
quux]: https://haskell.org
[first
second]: https://haskell.org
[^third
fourth]: not a footnote definition
[baz\
quux]
[^foo\
bar]
[first
second]
[^third
fourth]
.
<p>[^foo<br />
bar]: not a footnote definition</p>
<p>[^third
fourth]: not a footnote definition</p>
<p><a href="https://haskell.org">baz<br />
quux</a>
[^foo<br />
bar]
<a href="https://haskell.org">first
second</a>
[^third
fourth]</p>
````````````````````````````````
Paragraphs in footnotes can be lazily wrapped (#126).
```````````````````````````````` example
[^foo]:bar
baz
[^foo]
.
<p><sup class="footnote-ref"><a href="#fn-foo" id="fnref-foo">1</a></sup></p>
<section class="footnotes">
<div class="footnote" id="fn-foo">
<div class="footnote-number">
<a href="#fnref-foo">1</a>
</div>
<div class="footnote-contents">
<p>bar
baz</p>
</div>
</div>
</section>
````````````````````````````````
|