footnote_block.unit 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289
  1. >>> footnote reference in footnote definition
  2. Footnote 1 link[^first].
  3. [^first]: footnote reference in footnote definition[^first]
  4. <<<
  5. <p>Footnote 1 link<sup class="footnote-ref"><a href="#fn-first" id="fnref-first">1</a></sup>.</p>
  6. <section class="footnotes">
  7. <ol>
  8. <li id="fn-first">
  9. <p>footnote reference in footnote definition<sup class="footnote-ref"><a href="#fn-first" id="fnref-first-2">1</a></sup> <a href="#fnref-first" class="footnote-backref">↩</a> <a href="#fnref-first-2" class="footnote-backref">↩<sup class="footnote-ref">2</sup></a></p>
  10. </li>
  11. </ol>
  12. </section>
  13. >>> footnote reference cases
  14. [^fifth]: ending with another ']' and different order
  15. Footnote 1 link[^first].
  16. Footnote 2 link[^きゃくちゅう脚注].
  17. Footnote 3 link[^p1 p2].
  18. Footnote 4 link![^forth].
  19. Footnote 5 link![^fifth]].
  20. Footnote 6 link![^ sixth ].
  21. Footnote 7 link[^きゃくちゅう脚注].
  22. [^first]: Here is the footnote definition
  23. [^きゃくちゅう脚注]: unicode label and duplicated reference.
  24. [^p1 p2]: p1 p2
  25. [^ForTh]: start with '[' and with upper case
  26. [^sixth]: label-start-with-blank
  27. <<<
  28. <p>Footnote 1 link<sup class="footnote-ref"><a href="#fn-first" id="fnref-first">1</a></sup>.</p>
  29. <p>Footnote 2 link<sup class="footnote-ref"><a href="#fn-%E3%81%8D%E3%82%83%E3%81%8F%E3%81%A1%E3%82%85%E3%81%86%E8%84%9A%E6%B3%A8" id="fnref-%E3%81%8D%E3%82%83%E3%81%8F%E3%81%A1%E3%82%85%E3%81%86%E8%84%9A%E6%B3%A8">2</a></sup>.</p>
  30. <p>Footnote 3 link[^p1 p2].</p>
  31. <p>Footnote 4 link!<sup class="footnote-ref"><a href="#fn-ForTh" id="fnref-ForTh">3</a></sup>.</p>
  32. <p>Footnote 5 link!<sup class="footnote-ref"><a href="#fn-fifth" id="fnref-fifth">4</a></sup>].</p>
  33. <p>Footnote 6 link!<sup class="footnote-ref"><a href="#fn-sixth" id="fnref-sixth">5</a></sup>.</p>
  34. <p>Footnote 7 link<sup class="footnote-ref"><a href="#fn-%E3%81%8D%E3%82%83%E3%81%8F%E3%81%A1%E3%82%85%E3%81%86%E8%84%9A%E6%B3%A8" id="fnref-%E3%81%8D%E3%82%83%E3%81%8F%E3%81%A1%E3%82%85%E3%81%86%E8%84%9A%E6%B3%A8-2">2</a></sup>.</p>
  35. <p>[^p1 p2]: p1 p2</p>
  36. <section class="footnotes">
  37. <ol>
  38. <li id="fn-first">
  39. <p>Here is the footnote definition <a href="#fnref-first" class="footnote-backref">↩</a></p>
  40. </li>
  41. <li id="fn-%E3%81%8D%E3%82%83%E3%81%8F%E3%81%A1%E3%82%85%E3%81%86%E8%84%9A%E6%B3%A8">
  42. <p>unicode label and duplicated reference. <a href="#fnref-%E3%81%8D%E3%82%83%E3%81%8F%E3%81%A1%E3%82%85%E3%81%86%E8%84%9A%E6%B3%A8" class="footnote-backref">↩</a> <a href="#fnref-%E3%81%8D%E3%82%83%E3%81%8F%E3%81%A1%E3%82%85%E3%81%86%E8%84%9A%E6%B3%A8-2" class="footnote-backref">↩<sup class="footnote-ref">2</sup></a></p>
  43. </li>
  44. <li id="fn-ForTh">
  45. <p>start with '[' and with upper case <a href="#fnref-ForTh" class="footnote-backref">↩</a></p>
  46. </li>
  47. <li id="fn-fifth">
  48. <p>ending with another ']' and different order <a href="#fnref-fifth" class="footnote-backref">↩</a></p>
  49. </li>
  50. <li id="fn-sixth">
  51. <p>label-start-with-blank <a href="#fnref-sixth" class="footnote-backref">↩</a></p>
  52. </li>
  53. </ol>
  54. </section>
  55. >>> footnote labels with special chars
  56. empty label[^] and blank label[^ ]
  57. some[^-] strange[^^] but[^\[] labels[^\[\]]
  58. [^]:
  59. [^ ]:
  60. [^-]: valid1
  61. [^^]:valid2
  62. [^\[]: valid3
  63. [^\[\]]: this-is-link-not-footnote
  64. <<<
  65. <p>empty label[^] and blank label[^ ]</p>
  66. <p>some<sup class="footnote-ref"><a href="#fn--" id="fnref--">1</a></sup> strange<sup class="footnote-ref"><a href="#fn-%5E" id="fnref-%5E">2</a></sup> but<sup class="footnote-ref"><a href="#fn-%5C%5B" id="fnref-%5C%5B">3</a></sup> labels<a href="this-is-link-not-footnote">^[]</a></p>
  67. <p>[^]:
  68. [^ ]:</p>
  69. <section class="footnotes">
  70. <ol>
  71. <li id="fn--">
  72. <p>valid1 <a href="#fnref--" class="footnote-backref">↩</a></p>
  73. </li>
  74. <li id="fn-%5E">
  75. <p>valid2 <a href="#fnref-%5E" class="footnote-backref">↩</a></p>
  76. </li>
  77. <li id="fn-%5C%5B">
  78. <p>valid3 <a href="#fnref-%5C%5B" class="footnote-backref">↩</a></p>
  79. </li>
  80. </ol>
  81. </section>
  82. >>> footnote with paragraph
  83. test footnote[^first].
  84. [^first]: Footnote **can have markup**
  85. and multiple paragraphs.
  86. "Smartypants, double quotes" and 'single quotes'
  87. <<<
  88. <p>test footnote<sup class="footnote-ref"><a href="#fn-first" id="fnref-first">1</a></sup>.</p>
  89. <p>&quot;Smartypants, double quotes&quot; and 'single quotes'</p>
  90. <section class="footnotes">
  91. <ol>
  92. <li id="fn-first">
  93. <p>Footnote <strong>can have markup</strong></p>
  94. <p>and multiple paragraphs. <a href="#fnref-first" class="footnote-backref">↩</a></p>
  95. </li>
  96. </ol>
  97. </section>
  98. >>> footnote adjacent paragraph
  99. Here is a footnote reference,[^1]
  100. [^1]: Here is the footnote.
  101. Subsequent paragraphs
  102. <<<
  103. <p>Here is a footnote reference,<sup class="footnote-ref"><a href="#fn-1" id="fnref-1">1</a></sup></p>
  104. <section class="footnotes">
  105. <ol>
  106. <li id="fn-1">
  107. <p>Here is the footnote.
  108. Subsequent paragraphs <a href="#fnref-1" class="footnote-backref">↩</a></p>
  109. </li>
  110. </ol>
  111. </section>
  112. >>> footnote without ref
  113. Here is a footnote reference
  114. [^1]: Here is the footnote.
  115. <<<
  116. <p>Here is a footnote reference</p>
  117. >>> footnote example from github
  118. Here is a simple footnote[^1].
  119. A footnote can also have multiple lines[^2].
  120. You can also use words, to fit your writing style more closely[^note].
  121. [^1]: My reference.
  122. [^2]: Every new line should be prefixed with 2 spaces.
  123. This allows you to have a footnote with multiple lines.
  124. [^note]:
  125. Named footnotes will still render with numbers instead of the text but allow easier identification and linking.
  126. This footnote also has been made with a different syntax using 4 spaces for new lines.
  127. <<<
  128. <p>Here is a simple footnote<sup class="footnote-ref"><a href="#fn-1" id="fnref-1">1</a></sup>.</p>
  129. <p>A footnote can also have multiple lines<sup class="footnote-ref"><a href="#fn-2" id="fnref-2">2</a></sup>.</p>
  130. <p>You can also use words, to fit your writing style more closely<sup class="footnote-ref"><a href="#fn-note" id="fnref-note">3</a></sup>.</p>
  131. <section class="footnotes">
  132. <ol>
  133. <li id="fn-1">
  134. <p>My reference. <a href="#fnref-1" class="footnote-backref">↩</a></p>
  135. </li>
  136. <li id="fn-2">
  137. <p>Every new line should be prefixed with 2 spaces.
  138. This allows you to have a footnote with multiple lines. <a href="#fnref-2" class="footnote-backref">↩</a></p>
  139. </li>
  140. <li id="fn-note">
  141. <p>Named footnotes will still render with numbers instead of the text but allow easier identification and linking.
  142. This footnote also has been made with a different syntax using 4 spaces for new lines. <a href="#fnref-note" class="footnote-backref">↩</a></p>
  143. </li>
  144. </ol>
  145. </section>
  146. >>> ![^ **image**] without definition should be formatted: unlike github
  147. ![^ **image**]
  148. <<<
  149. <p>![^ <strong>image</strong>]</p>
  150. >>> ![^ **image**] with definition should be image: unlike github
  151. ![^ **image**]
  152. [^ **image**]: valid-link
  153. <<<
  154. <p><img src="valid-link" alt="^ image" /></p>
  155. >>> ![^ **image**] with definition should be plain html: unlike github
  156. ![^ **image**]
  157. [^ **image**]: invalid link
  158. <<<
  159. <p>![^ <strong>image</strong>]</p>
  160. <p>[^ <strong>image</strong>]: invalid link</p>
  161. >>> ![ ^**image**] without definition should be formatted
  162. ![ ^**image**]
  163. <<<
  164. <p>![ ^<strong>image</strong>]</p>
  165. >>> ![^ ^**image**] without definition should be formatted: unlike github
  166. ![^ ^**image**]
  167. <<<
  168. <p>![^ ^<strong>image</strong>]</p>
  169. >>> ![^ ^**image**] with definition should be image: unlike github
  170. ![^ ^**image**]
  171. [^ ^**image**]: valid-link
  172. <<<
  173. <p><img src="valid-link" alt="^ ^image" /></p>
  174. >>> [^ **label**] without definition should be formatted: unlike github
  175. [^ **label**]
  176. <<<
  177. <p>[^ <strong>label</strong>]</p>
  178. >>> [adc][^**link**] without definition should be formatted: unlike github
  179. [adc][^**link**]
  180. <<<
  181. <p>[adc][^<strong>link</strong>]</p>
  182. >>> [adc][^**link**] with definition should be footnotes:
  183. [adc][^**link**]
  184. [^**link**]: valid-link
  185. <<<
  186. <p>[adc]<sup class="footnote-ref"><a href="#fn-**link**" id="fnref-**link**">1</a></sup></p>
  187. <section class="footnotes">
  188. <ol>
  189. <li id="fn-**link**">
  190. <p>valid-link <a href="#fnref-**link**" class="footnote-backref">↩</a></p>
  191. </li>
  192. </ol>
  193. </section>
  194. >>> \[^good] should be text
  195. \[^good]
  196. [^good]: good
  197. <<<
  198. <p>[^good]</p>
  199. >>>[^ nice] should be link
  200. [^ nice]
  201. [^ nice ]: good
  202. <<<
  203. <p><a href="good">^ nice</a></p>
  204. >>>[^ nice ] should be text
  205. [^ nice ]
  206. [^nice ]: good
  207. <<<
  208. <p>[^ nice ]</p>
  209. >>> [^\]] with definition should be link
  210. [^\]]
  211. [^\]]: good
  212. <<<
  213. <p><a href="good">^]</a></p>
  214. >>> [^a-\nb] with definition should be paragraph
  215. [^a-
  216. b]
  217. [^a-
  218. b]: good
  219. <<<
  220. <p><a href="good">^a-
  221. b</a></p>
  222. >>> [^a] with error definition should be text
  223. [^a]
  224. [^a\]: good
  225. <<<
  226. <p>[^a]</p>
  227. >>> [^a] with double definition contain '\]' should be text
  228. [^a]
  229. [^a\]:]: definition contain '\]'
  230. <<<
  231. <p>[^a]</p>
  232. >>> [^a] with double definition trailing should be footnote
  233. [^a]
  234. [^a]:]: good
  235. <<<
  236. <p><sup class="footnote-ref"><a href="#fn-a" id="fnref-a">1</a></sup></p>
  237. <section class="footnotes">
  238. <ol>
  239. <li id="fn-a">
  240. <p>]: good <a href="#fnref-a" class="footnote-backref">↩</a></p>
  241. </li>
  242. </ol>
  243. </section>
  244. >>> complete image link with definition would be image: unlike github
  245. ![^image](example.png)
  246. [^image]: image footnote
  247. <<<
  248. <p><img src="example.png" alt="^image" /></p>