all repos — grayfriday @ 472fe3a75661156c826b7b148cd4c0c0e28f84a9

blackfriday fork with a few changes

inline_test.go (view raw)

  1//
  2// Blackfriday Markdown Processor
  3// Available at http://github.com/russross/blackfriday
  4//
  5// Copyright © 2011 Russ Ross <russ@russross.com>.
  6// Distributed under the Simplified BSD License.
  7// See README.md for details.
  8//
  9
 10//
 11// Unit tests for inline parsing
 12//
 13
 14package blackfriday
 15
 16import (
 17	"testing"
 18)
 19
 20func runMarkdownInline(input string, extensions, htmlFlags int) string {
 21	extensions |= EXTENSION_AUTOLINK
 22	extensions |= EXTENSION_STRIKETHROUGH
 23
 24	htmlFlags |= HTML_USE_XHTML
 25
 26	renderer := HtmlRenderer(htmlFlags, "", "")
 27
 28	return string(Markdown([]byte(input), renderer, extensions))
 29}
 30
 31func doTestsInline(t *testing.T, tests []string) {
 32	doTestsInlineParam(t, tests, 0, 0)
 33}
 34
 35func doTestsInlineParam(t *testing.T, tests []string, extensions, htmlFlags int) {
 36	// catch and report panics
 37	var candidate string
 38	/*
 39		defer func() {
 40			if err := recover(); err != nil {
 41				t.Errorf("\npanic while processing [%#v] (%v)\n", candidate, err)
 42			}
 43		}()
 44	*/
 45
 46	for i := 0; i+1 < len(tests); i += 2 {
 47		input := tests[i]
 48		candidate = input
 49		expected := tests[i+1]
 50		actual := runMarkdownInline(candidate, extensions, htmlFlags)
 51		if actual != expected {
 52			t.Errorf("\nInput   [%#v]\nExpected[%#v]\nActual  [%#v]",
 53				candidate, expected, actual)
 54		}
 55
 56		// now test every substring to stress test bounds checking
 57		if !testing.Short() {
 58			for start := 0; start < len(input); start++ {
 59				for end := start + 1; end <= len(input); end++ {
 60					candidate = input[start:end]
 61					_ = runMarkdownInline(candidate, extensions, htmlFlags)
 62				}
 63			}
 64		}
 65	}
 66}
 67
 68func TestRawHtmlTag(t *testing.T) {
 69	tests := []string{
 70		"zz <style>p {}</style>\n",
 71		"<p>zz p {}</p>\n",
 72
 73		"zz <STYLE>p {}</STYLE>\n",
 74		"<p>zz p {}</p>\n",
 75
 76		"<SCRIPT>alert()</SCRIPT>\n",
 77		"<p>alert()</p>\n",
 78
 79		"zz <SCRIPT>alert()</SCRIPT>\n",
 80		"<p>zz alert()</p>\n",
 81
 82		"zz <script>alert()</script>\n",
 83		"<p>zz alert()</p>\n",
 84
 85		" <script>alert()</script>\n",
 86		"<p>alert()</p>\n",
 87
 88		"<script>alert()</script>\n",
 89		"<p>alert()</p>\n",
 90
 91		"<script src='foo'></script>\n",
 92		"<p></p>\n",
 93
 94		"zz <script src='foo'></script>\n",
 95		"<p>zz </p>\n",
 96
 97		"zz <script src=foo></script>\n",
 98		"<p>zz </p>\n",
 99	}
100	doTestsInlineParam(t, tests, 0, HTML_SKIP_STYLE|HTML_SKIP_SCRIPT)
101}
102
103func TestEmphasis(t *testing.T) {
104	var tests = []string{
105		"nothing inline\n",
106		"<p>nothing inline</p>\n",
107
108		"simple *inline* test\n",
109		"<p>simple <em>inline</em> test</p>\n",
110
111		"*at the* beginning\n",
112		"<p><em>at the</em> beginning</p>\n",
113
114		"at the *end*\n",
115		"<p>at the <em>end</em></p>\n",
116
117		"*try two* in *one line*\n",
118		"<p><em>try two</em> in <em>one line</em></p>\n",
119
120		"over *two\nlines* test\n",
121		"<p>over <em>two\nlines</em> test</p>\n",
122
123		"odd *number of* markers* here\n",
124		"<p>odd <em>number of</em> markers* here</p>\n",
125
126		"odd *number\nof* markers* here\n",
127		"<p>odd <em>number\nof</em> markers* here</p>\n",
128
129		"simple _inline_ test\n",
130		"<p>simple <em>inline</em> test</p>\n",
131
132		"_at the_ beginning\n",
133		"<p><em>at the</em> beginning</p>\n",
134
135		"at the _end_\n",
136		"<p>at the <em>end</em></p>\n",
137
138		"_try two_ in _one line_\n",
139		"<p><em>try two</em> in <em>one line</em></p>\n",
140
141		"over _two\nlines_ test\n",
142		"<p>over <em>two\nlines</em> test</p>\n",
143
144		"odd _number of_ markers_ here\n",
145		"<p>odd <em>number of</em> markers_ here</p>\n",
146
147		"odd _number\nof_ markers_ here\n",
148		"<p>odd <em>number\nof</em> markers_ here</p>\n",
149
150		"mix of *markers_\n",
151		"<p>mix of *markers_</p>\n",
152	}
153	doTestsInline(t, tests)
154}
155
156func TestStrong(t *testing.T) {
157	var tests = []string{
158		"nothing inline\n",
159		"<p>nothing inline</p>\n",
160
161		"simple **inline** test\n",
162		"<p>simple <strong>inline</strong> test</p>\n",
163
164		"**at the** beginning\n",
165		"<p><strong>at the</strong> beginning</p>\n",
166
167		"at the **end**\n",
168		"<p>at the <strong>end</strong></p>\n",
169
170		"**try two** in **one line**\n",
171		"<p><strong>try two</strong> in <strong>one line</strong></p>\n",
172
173		"over **two\nlines** test\n",
174		"<p>over <strong>two\nlines</strong> test</p>\n",
175
176		"odd **number of** markers** here\n",
177		"<p>odd <strong>number of</strong> markers** here</p>\n",
178
179		"odd **number\nof** markers** here\n",
180		"<p>odd <strong>number\nof</strong> markers** here</p>\n",
181
182		"simple __inline__ test\n",
183		"<p>simple <strong>inline</strong> test</p>\n",
184
185		"__at the__ beginning\n",
186		"<p><strong>at the</strong> beginning</p>\n",
187
188		"at the __end__\n",
189		"<p>at the <strong>end</strong></p>\n",
190
191		"__try two__ in __one line__\n",
192		"<p><strong>try two</strong> in <strong>one line</strong></p>\n",
193
194		"over __two\nlines__ test\n",
195		"<p>over <strong>two\nlines</strong> test</p>\n",
196
197		"odd __number of__ markers__ here\n",
198		"<p>odd <strong>number of</strong> markers__ here</p>\n",
199
200		"odd __number\nof__ markers__ here\n",
201		"<p>odd <strong>number\nof</strong> markers__ here</p>\n",
202
203		"mix of **markers__\n",
204		"<p>mix of **markers__</p>\n",
205	}
206	doTestsInline(t, tests)
207}
208
209func TestEmphasisMix(t *testing.T) {
210	var tests = []string{
211		"***triple emphasis***\n",
212		"<p><strong><em>triple emphasis</em></strong></p>\n",
213
214		"***triple\nemphasis***\n",
215		"<p><strong><em>triple\nemphasis</em></strong></p>\n",
216
217		"___triple emphasis___\n",
218		"<p><strong><em>triple emphasis</em></strong></p>\n",
219
220		"***triple emphasis___\n",
221		"<p>***triple emphasis___</p>\n",
222
223		"*__triple emphasis__*\n",
224		"<p><em><strong>triple emphasis</strong></em></p>\n",
225
226		"__*triple emphasis*__\n",
227		"<p><strong><em>triple emphasis</em></strong></p>\n",
228
229		"**improper *nesting** is* bad\n",
230		"<p><strong>improper *nesting</strong> is* bad</p>\n",
231
232		"*improper **nesting* is** bad\n",
233		"<p><em>improper **nesting</em> is** bad</p>\n",
234	}
235	doTestsInline(t, tests)
236}
237
238func TestStrikeThrough(t *testing.T) {
239	var tests = []string{
240		"nothing inline\n",
241		"<p>nothing inline</p>\n",
242
243		"simple ~~inline~~ test\n",
244		"<p>simple <del>inline</del> test</p>\n",
245
246		"~~at the~~ beginning\n",
247		"<p><del>at the</del> beginning</p>\n",
248
249		"at the ~~end~~\n",
250		"<p>at the <del>end</del></p>\n",
251
252		"~~try two~~ in ~~one line~~\n",
253		"<p><del>try two</del> in <del>one line</del></p>\n",
254
255		"over ~~two\nlines~~ test\n",
256		"<p>over <del>two\nlines</del> test</p>\n",
257
258		"odd ~~number of~~ markers~~ here\n",
259		"<p>odd <del>number of</del> markers~~ here</p>\n",
260
261		"odd ~~number\nof~~ markers~~ here\n",
262		"<p>odd <del>number\nof</del> markers~~ here</p>\n",
263	}
264	doTestsInline(t, tests)
265}
266
267func TestCodeSpan(t *testing.T) {
268	var tests = []string{
269		"`source code`\n",
270		"<p><code>source code</code></p>\n",
271
272		"` source code with spaces `\n",
273		"<p><code>source code with spaces</code></p>\n",
274
275		"` source code with spaces `not here\n",
276		"<p><code>source code with spaces</code>not here</p>\n",
277
278		"a `single marker\n",
279		"<p>a `single marker</p>\n",
280
281		"a single multi-tick marker with ``` no text\n",
282		"<p>a single multi-tick marker with ``` no text</p>\n",
283
284		"markers with ` ` a space\n",
285		"<p>markers with  a space</p>\n",
286
287		"`source code` and a `stray\n",
288		"<p><code>source code</code> and a `stray</p>\n",
289
290		"`source *with* _awkward characters_ in it`\n",
291		"<p><code>source *with* _awkward characters_ in it</code></p>\n",
292
293		"`split over\ntwo lines`\n",
294		"<p><code>split over\ntwo lines</code></p>\n",
295
296		"```multiple ticks``` for the marker\n",
297		"<p><code>multiple ticks</code> for the marker</p>\n",
298
299		"```multiple ticks `with` ticks inside```\n",
300		"<p><code>multiple ticks `with` ticks inside</code></p>\n",
301	}
302	doTestsInline(t, tests)
303}
304
305func TestLineBreak(t *testing.T) {
306	var tests = []string{
307		"this line  \nhas a break\n",
308		"<p>this line<br />\nhas a break</p>\n",
309
310		"this line \ndoes not\n",
311		"<p>this line\ndoes not</p>\n",
312
313		"this has an   \nextra space\n",
314		"<p>this has an<br />\nextra space</p>\n",
315	}
316	doTestsInline(t, tests)
317}
318
319func TestInlineLink(t *testing.T) {
320	var tests = []string{
321		"[foo](/bar/)\n",
322		"<p><a href=\"/bar/\">foo</a></p>\n",
323
324		"[foo with a title](/bar/ \"title\")\n",
325		"<p><a href=\"/bar/\" title=\"title\">foo with a title</a></p>\n",
326
327		"[foo with a title](/bar/\t\"title\")\n",
328		"<p><a href=\"/bar/\" title=\"title\">foo with a title</a></p>\n",
329
330		"[foo with a title](/bar/ \"title\"  )\n",
331		"<p><a href=\"/bar/\" title=\"title\">foo with a title</a></p>\n",
332
333		"[foo with a title](/bar/ title with no quotes)\n",
334		"<p><a href=\"/bar/ title with no quotes\">foo with a title</a></p>\n",
335
336		"[foo]()\n",
337		"<p>[foo]()</p>\n",
338
339		"![foo](/bar/)\n",
340		"<p><img src=\"/bar/\" alt=\"foo\" />\n</p>\n",
341
342		"![foo with a title](/bar/ \"title\")\n",
343		"<p><img src=\"/bar/\" alt=\"foo with a title\" title=\"title\" />\n</p>\n",
344
345		"![foo with a title](/bar/\t\"title\")\n",
346		"<p><img src=\"/bar/\" alt=\"foo with a title\" title=\"title\" />\n</p>\n",
347
348		"![foo with a title](/bar/ \"title\"  )\n",
349		"<p><img src=\"/bar/\" alt=\"foo with a title\" title=\"title\" />\n</p>\n",
350
351		"![foo with a title](/bar/ title with no quotes)\n",
352		"<p><img src=\"/bar/ title with no quotes\" alt=\"foo with a title\" />\n</p>\n",
353
354		"![foo]()\n",
355		"<p>![foo]()</p>\n",
356
357		"[a link]\t(/with_a_tab/)\n",
358		"<p><a href=\"/with_a_tab/\">a link</a></p>\n",
359
360		"[a link]  (/with_spaces/)\n",
361		"<p><a href=\"/with_spaces/\">a link</a></p>\n",
362
363		"[text (with) [[nested] (brackets)]](/url/)\n",
364		"<p><a href=\"/url/\">text (with) [[nested] (brackets)]</a></p>\n",
365
366		"[text (with) [broken nested] (brackets)]](/url/)\n",
367		"<p>[text (with) <a href=\"brackets\">broken nested</a>]](/url/)</p>\n",
368
369		"[text\nwith a newline](/link/)\n",
370		"<p><a href=\"/link/\">text\nwith a newline</a></p>\n",
371
372		"[text in brackets] [followed](/by a link/)\n",
373		"<p>[text in brackets] <a href=\"/by a link/\">followed</a></p>\n",
374
375		"[link with\\] a closing bracket](/url/)\n",
376		"<p><a href=\"/url/\">link with] a closing bracket</a></p>\n",
377
378		"[link with\\[ an opening bracket](/url/)\n",
379		"<p><a href=\"/url/\">link with[ an opening bracket</a></p>\n",
380
381		"[link with\\) a closing paren](/url/)\n",
382		"<p><a href=\"/url/\">link with) a closing paren</a></p>\n",
383
384		"[link with\\( an opening paren](/url/)\n",
385		"<p><a href=\"/url/\">link with( an opening paren</a></p>\n",
386
387		"[link](  with whitespace)\n",
388		"<p><a href=\"with whitespace\">link</a></p>\n",
389
390		"[link](  with whitespace   )\n",
391		"<p><a href=\"with whitespace\">link</a></p>\n",
392
393		"[![image](someimage)](with image)\n",
394		"<p><a href=\"with image\"><img src=\"someimage\" alt=\"image\" />\n</a></p>\n",
395
396		"[link](url \"one quote)\n",
397		"<p><a href=\"url &quot;one quote\">link</a></p>\n",
398
399		"[link](url 'one quote)\n",
400		"<p><a href=\"url 'one quote\">link</a></p>\n",
401
402		"[link](<url>)\n",
403		"<p><a href=\"url\">link</a></p>\n",
404
405		"[link & ampersand](/url/)\n",
406		"<p><a href=\"/url/\">link &amp; ampersand</a></p>\n",
407
408		"[link &amp; ampersand](/url/)\n",
409		"<p><a href=\"/url/\">link &amp; ampersand</a></p>\n",
410
411		"[link](/url/&query)\n",
412		"<p><a href=\"/url/&amp;query\">link</a></p>\n",
413	}
414	doTestsInline(t, tests)
415}
416
417func TestReferenceLink(t *testing.T) {
418	var tests = []string{
419		"[link][ref]\n",
420		"<p>[link][ref]</p>\n",
421
422		"[link][ref]\n   [ref]: /url/ \"title\"\n",
423		"<p><a href=\"/url/\" title=\"title\">link</a></p>\n",
424
425		"[link][ref]\n   [ref]: /url/\n",
426		"<p><a href=\"/url/\">link</a></p>\n",
427
428		"   [ref]: /url/\n",
429		"",
430
431		"   [ref]: /url/\n[ref2]: /url/\n [ref3]: /url/\n",
432		"",
433
434		"   [ref]: /url/\n[ref2]: /url/\n [ref3]: /url/\n    [4spaces]: /url/\n",
435		"<pre><code>[4spaces]: /url/\n</code></pre>\n",
436
437		"[hmm](ref2)\n   [ref]: /url/\n[ref2]: /url/\n [ref3]: /url/\n",
438		"<p><a href=\"ref2\">hmm</a></p>\n",
439
440		"[ref]\n",
441		"<p>[ref]</p>\n",
442
443		"[ref]\n   [ref]: /url/ \"title\"\n",
444		"<p><a href=\"/url/\" title=\"title\">ref</a></p>\n",
445	}
446	doTestsInline(t, tests)
447}
448
449func TestTags(t *testing.T) {
450	var tests = []string{
451		"a <span>tag</span>\n",
452		"<p>a <span>tag</span></p>\n",
453
454		"<span>tag</span>\n",
455		"<p><span>tag</span></p>\n",
456
457		"<span>mismatch</spandex>\n",
458		"<p><span>mismatch</spandex></p>\n",
459
460		"a <singleton /> tag\n",
461		"<p>a <singleton /> tag</p>\n",
462	}
463	doTestsInline(t, tests)
464}
465
466func TestAutoLink(t *testing.T) {
467	var tests = []string{
468		"http://foo.com/\n",
469		"<p><a href=\"http://foo.com/\">http://foo.com/</a></p>\n",
470
471		"1 http://foo.com/\n",
472		"<p>1 <a href=\"http://foo.com/\">http://foo.com/</a></p>\n",
473
474		"1http://foo.com/\n",
475		"<p>1<a href=\"http://foo.com/\">http://foo.com/</a></p>\n",
476
477		"1.http://foo.com/\n",
478		"<p>1.<a href=\"http://foo.com/\">http://foo.com/</a></p>\n",
479
480		"1. http://foo.com/\n",
481		"<ol>\n<li><a href=\"http://foo.com/\">http://foo.com/</a></li>\n</ol>\n",
482
483		"-http://foo.com/\n",
484		"<p>-<a href=\"http://foo.com/\">http://foo.com/</a></p>\n",
485
486		"- http://foo.com/\n",
487		"<ul>\n<li><a href=\"http://foo.com/\">http://foo.com/</a></li>\n</ul>\n",
488
489		"_http://foo.com/\n",
490		"<p>_<a href=\"http://foo.com/\">http://foo.com/</a></p>\n",
491
492		"令狐http://foo.com/\n",
493		"<p>令狐<a href=\"http://foo.com/\">http://foo.com/</a></p>\n",
494
495		"令狐 http://foo.com/\n",
496		"<p>令狐 <a href=\"http://foo.com/\">http://foo.com/</a></p>\n",
497
498		"ahttp://foo.com/\n",
499		"<p>ahttp://foo.com/</p>\n",
500
501		">http://foo.com/\n",
502		"<blockquote>\n<p><a href=\"http://foo.com/\">http://foo.com/</a></p>\n</blockquote>\n",
503
504		"> http://foo.com/\n",
505		"<blockquote>\n<p><a href=\"http://foo.com/\">http://foo.com/</a></p>\n</blockquote>\n",
506
507		"go to <http://foo.com/>\n",
508		"<p>go to <a href=\"http://foo.com/\">http://foo.com/</a></p>\n",
509
510		"a secure <https://link.org>\n",
511		"<p>a secure <a href=\"https://link.org\">https://link.org</a></p>\n",
512
513		"an email <mailto:some@one.com>\n",
514		"<p>an email <a href=\"mailto:some@one.com\">some@one.com</a></p>\n",
515
516		"an email <mailto://some@one.com>\n",
517		"<p>an email <a href=\"mailto://some@one.com\">some@one.com</a></p>\n",
518
519		"an email <some@one.com>\n",
520		"<p>an email <a href=\"mailto:some@one.com\">some@one.com</a></p>\n",
521
522		"an ftp <ftp://old.com>\n",
523		"<p>an ftp <a href=\"ftp://old.com\">ftp://old.com</a></p>\n",
524
525		"an ftp <ftp:old.com>\n",
526		"<p>an ftp <a href=\"ftp:old.com\">ftp:old.com</a></p>\n",
527
528		"a link with <http://new.com?query=foo&bar>\n",
529		"<p>a link with <a href=\"http://new.com?query=foo&amp;bar\">" +
530			"http://new.com?query=foo&amp;bar</a></p>\n",
531
532		"quotes mean a tag <http://new.com?query=\"foo\"&bar>\n",
533		"<p>quotes mean a tag <http://new.com?query=\"foo\"&bar></p>\n",
534
535		"quotes mean a tag <http://new.com?query='foo'&bar>\n",
536		"<p>quotes mean a tag <http://new.com?query='foo'&bar></p>\n",
537
538		"unless escaped <http://new.com?query=\\\"foo\\\"&bar>\n",
539		"<p>unless escaped <a href=\"http://new.com?query=&quot;foo&quot;&amp;bar\">" +
540			"http://new.com?query=&quot;foo&quot;&amp;bar</a></p>\n",
541
542		"even a > can be escaped <http://new.com?q=\\>&etc>\n",
543		"<p>even a &gt; can be escaped <a href=\"http://new.com?q=&gt;&amp;etc\">" +
544			"http://new.com?q=&gt;&amp;etc</a></p>\n",
545	}
546	doTestsInline(t, tests)
547}
548
549func TestFootnotes(t *testing.T) {
550	tests := []string{
551		"testing footnotes.[^a]\n\n[^a]: This is the note\n",
552		`<p>testing footnotes.<sup class="footnote-ref" id="fnref:a"><a rel="footnote" href="#fn:a">1</a></sup></p>
553<div class="footnotes">
554
555<hr />
556
557<ol>
558<li id="fn:a">This is the note
559</li>
560</ol>
561</div>
562`,
563
564		`testing long[^b] notes.
565
566[^b]: Paragraph 1
567
568	Paragraph 2
569	
570	` + "```\n\tsome code\n\t```" + `
571	
572	Paragraph 3
573
574No longer in the footnote
575`,
576		`<p>testing long<sup class="footnote-ref" id="fnref:b"><a rel="footnote" href="#fn:b">1</a></sup> notes.</p>
577
578<p>No longer in the footnote</p>
579<div class="footnotes">
580
581<hr />
582
583<ol>
584<li id="fn:b"><p>Paragraph 1</p>
585
586<p>Paragraph 2</p>
587
588<p><code>
589some code
590</code></p>
591
592<p>Paragraph 3</p>
593</li>
594</ol>
595</div>
596`,
597
598		`testing[^c] multiple[^d] notes.
599
600[^c]: this is [note] c
601
602
603omg
604
605[^d]: this is note d
606
607what happens here
608
609[note]: /link/c
610
611`,
612		`<p>testing<sup class="footnote-ref" id="fnref:c"><a rel="footnote" href="#fn:c">1</a></sup> multiple<sup class="footnote-ref" id="fnref:d"><a rel="footnote" href="#fn:d">2</a></sup> notes.</p>
613
614<p>omg</p>
615
616<p>what happens here</p>
617<div class="footnotes">
618
619<hr />
620
621<ol>
622<li id="fn:c">this is <a href="/link/c">note</a> c
623</li>
624<li id="fn:d">this is note d
625</li>
626</ol>
627</div>
628`,
629
630		"testing inline^[this is the note] notes.\n",
631		`<p>testing inline<sup class="footnote-ref" id="fnref:this-is-the-note"><a rel="footnote" href="#fn:this-is-the-note">1</a></sup> notes.</p>
632<div class="footnotes">
633
634<hr />
635
636<ol>
637<li id="fn:this-is-the-note">this is the note</li>
638</ol>
639</div>
640`,
641
642		"testing multiple[^1] types^[inline note] of notes[^2]\n\n[^2]: the second deferred note\n[^1]: the first deferred note\n\n\twhich happens to be a block\n",
643		`<p>testing multiple<sup class="footnote-ref" id="fnref:1"><a rel="footnote" href="#fn:1">1</a></sup> types<sup class="footnote-ref" id="fnref:inline-note"><a rel="footnote" href="#fn:inline-note">2</a></sup> of notes<sup class="footnote-ref" id="fnref:2"><a rel="footnote" href="#fn:2">3</a></sup></p>
644<div class="footnotes">
645
646<hr />
647
648<ol>
649<li id="fn:1"><p>the first deferred note</p>
650
651<p>which happens to be a block</p>
652</li>
653<li id="fn:inline-note">inline note</li>
654<li id="fn:2">the second deferred note
655</li>
656</ol>
657</div>
658`,
659
660		`This is a footnote[^1]^[and this is an inline footnote]
661
662[^1]: the footnote text.
663
664    may be multiple paragraphs.
665`,
666		`<p>This is a footnote<sup class="footnote-ref" id="fnref:1"><a rel="footnote" href="#fn:1">1</a></sup><sup class="footnote-ref" id="fnref:and-this-is-an-i"><a rel="footnote" href="#fn:and-this-is-an-i">2</a></sup></p>
667<div class="footnotes">
668
669<hr />
670
671<ol>
672<li id="fn:1"><p>the footnote text.</p>
673
674<p>may be multiple paragraphs.</p>
675</li>
676<li id="fn:and-this-is-an-i">and this is an inline footnote</li>
677</ol>
678</div>
679`,
680
681		"empty footnote[^]\n\n[^]: fn text",
682		"<p>empty footnote<sup class=\"footnote-ref\" id=\"fnref:\"><a rel=\"footnote\" href=\"#fn:\">1</a></sup></p>\n<div class=\"footnotes\">\n\n<hr />\n\n<ol>\n<li id=\"fn:\">fn text\n</li>\n</ol>\n</div>\n",
683	}
684
685	doTestsInlineParam(t, tests, EXTENSION_FOOTNOTES, 0)
686}