all repos — grayfriday @ ca82b8db3a85c5da858a1ec7c344872626ea2e81

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		"[[t]](/t)\n",
415		"<p><a href=\"/t\">[t]</a></p>\n",
416	}
417	doTestsInline(t, tests)
418}
419
420func TestReferenceLink(t *testing.T) {
421	var tests = []string{
422		"[link][ref]\n",
423		"<p>[link][ref]</p>\n",
424
425		"[link][ref]\n   [ref]: /url/ \"title\"\n",
426		"<p><a href=\"/url/\" title=\"title\">link</a></p>\n",
427
428		"[link][ref]\n   [ref]: /url/\n",
429		"<p><a href=\"/url/\">link</a></p>\n",
430
431		"   [ref]: /url/\n",
432		"",
433
434		"   [ref]: /url/\n[ref2]: /url/\n [ref3]: /url/\n",
435		"",
436
437		"   [ref]: /url/\n[ref2]: /url/\n [ref3]: /url/\n    [4spaces]: /url/\n",
438		"<pre><code>[4spaces]: /url/\n</code></pre>\n",
439
440		"[hmm](ref2)\n   [ref]: /url/\n[ref2]: /url/\n [ref3]: /url/\n",
441		"<p><a href=\"ref2\">hmm</a></p>\n",
442
443		"[ref]\n",
444		"<p>[ref]</p>\n",
445
446		"[ref]\n   [ref]: /url/ \"title\"\n",
447		"<p><a href=\"/url/\" title=\"title\">ref</a></p>\n",
448	}
449	doTestsInline(t, tests)
450}
451
452func TestTags(t *testing.T) {
453	var tests = []string{
454		"a <span>tag</span>\n",
455		"<p>a <span>tag</span></p>\n",
456
457		"<span>tag</span>\n",
458		"<p><span>tag</span></p>\n",
459
460		"<span>mismatch</spandex>\n",
461		"<p><span>mismatch</spandex></p>\n",
462
463		"a <singleton /> tag\n",
464		"<p>a <singleton /> tag</p>\n",
465	}
466	doTestsInline(t, tests)
467}
468
469func TestAutoLink(t *testing.T) {
470	var tests = []string{
471		"http://foo.com/\n",
472		"<p><a href=\"http://foo.com/\">http://foo.com/</a></p>\n",
473
474		"1 http://foo.com/\n",
475		"<p>1 <a href=\"http://foo.com/\">http://foo.com/</a></p>\n",
476
477		"1http://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		"<p>1.<a href=\"http://foo.com/\">http://foo.com/</a></p>\n",
482
483		"1. http://foo.com/\n",
484		"<ol>\n<li><a href=\"http://foo.com/\">http://foo.com/</a></li>\n</ol>\n",
485
486		"-http://foo.com/\n",
487		"<p>-<a href=\"http://foo.com/\">http://foo.com/</a></p>\n",
488
489		"- http://foo.com/\n",
490		"<ul>\n<li><a href=\"http://foo.com/\">http://foo.com/</a></li>\n</ul>\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		"令狐 http://foo.com/\n",
499		"<p>令狐 <a href=\"http://foo.com/\">http://foo.com/</a></p>\n",
500
501		"ahttp://foo.com/\n",
502		"<p>ahttp://foo.com/</p>\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		"> http://foo.com/\n",
508		"<blockquote>\n<p><a href=\"http://foo.com/\">http://foo.com/</a></p>\n</blockquote>\n",
509
510		"go to <http://foo.com/>\n",
511		"<p>go to <a href=\"http://foo.com/\">http://foo.com/</a></p>\n",
512
513		"a secure <https://link.org>\n",
514		"<p>a secure <a href=\"https://link.org\">https://link.org</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 <mailto://some@one.com>\n",
520		"<p>an email <a href=\"mailto://some@one.com\">some@one.com</a></p>\n",
521
522		"an email <some@one.com>\n",
523		"<p>an email <a href=\"mailto:some@one.com\">some@one.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		"an ftp <ftp:old.com>\n",
529		"<p>an ftp <a href=\"ftp:old.com\">ftp:old.com</a></p>\n",
530
531		"a link with <http://new.com?query=foo&bar>\n",
532		"<p>a link with <a href=\"http://new.com?query=foo&amp;bar\">" +
533			"http://new.com?query=foo&amp;bar</a></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		"quotes mean a tag <http://new.com?query='foo'&bar>\n",
539		"<p>quotes mean a tag <http://new.com?query='foo'&bar></p>\n",
540
541		"unless escaped <http://new.com?query=\\\"foo\\\"&bar>\n",
542		"<p>unless escaped <a href=\"http://new.com?query=&quot;foo&quot;&amp;bar\">" +
543			"http://new.com?query=&quot;foo&quot;&amp;bar</a></p>\n",
544
545		"even a > can be escaped <http://new.com?q=\\>&etc>\n",
546		"<p>even a &gt; can be escaped <a href=\"http://new.com?q=&gt;&amp;etc\">" +
547			"http://new.com?q=&gt;&amp;etc</a></p>\n",
548	}
549	doTestsInline(t, tests)
550}
551
552func TestFootnotes(t *testing.T) {
553	tests := []string{
554		"testing footnotes.[^a]\n\n[^a]: This is the note\n",
555		`<p>testing footnotes.<sup class="footnote-ref" id="fnref:a"><a rel="footnote" href="#fn:a">1</a></sup></p>
556<div class="footnotes">
557
558<hr />
559
560<ol>
561<li id="fn:a">This is the note
562</li>
563</ol>
564</div>
565`,
566
567		`testing long[^b] notes.
568
569[^b]: Paragraph 1
570
571	Paragraph 2
572	
573	` + "```\n\tsome code\n\t```" + `
574	
575	Paragraph 3
576
577No longer in the footnote
578`,
579		`<p>testing long<sup class="footnote-ref" id="fnref:b"><a rel="footnote" href="#fn:b">1</a></sup> notes.</p>
580
581<p>No longer in the footnote</p>
582<div class="footnotes">
583
584<hr />
585
586<ol>
587<li id="fn:b"><p>Paragraph 1</p>
588
589<p>Paragraph 2</p>
590
591<p><code>
592some code
593</code></p>
594
595<p>Paragraph 3</p>
596</li>
597</ol>
598</div>
599`,
600
601		`testing[^c] multiple[^d] notes.
602
603[^c]: this is [note] c
604
605
606omg
607
608[^d]: this is note d
609
610what happens here
611
612[note]: /link/c
613
614`,
615		`<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>
616
617<p>omg</p>
618
619<p>what happens here</p>
620<div class="footnotes">
621
622<hr />
623
624<ol>
625<li id="fn:c">this is <a href="/link/c">note</a> c
626</li>
627<li id="fn:d">this is note d
628</li>
629</ol>
630</div>
631`,
632
633		"testing inline^[this is the note] notes.\n",
634		`<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>
635<div class="footnotes">
636
637<hr />
638
639<ol>
640<li id="fn:this-is-the-note">this is the note</li>
641</ol>
642</div>
643`,
644
645		"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",
646		`<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>
647<div class="footnotes">
648
649<hr />
650
651<ol>
652<li id="fn:1"><p>the first deferred note</p>
653
654<p>which happens to be a block</p>
655</li>
656<li id="fn:inline-note">inline note</li>
657<li id="fn:2">the second deferred note
658</li>
659</ol>
660</div>
661`,
662
663		`This is a footnote[^1]^[and this is an inline footnote]
664
665[^1]: the footnote text.
666
667    may be multiple paragraphs.
668`,
669		`<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>
670<div class="footnotes">
671
672<hr />
673
674<ol>
675<li id="fn:1"><p>the footnote text.</p>
676
677<p>may be multiple paragraphs.</p>
678</li>
679<li id="fn:and-this-is-an-i">and this is an inline footnote</li>
680</ol>
681</div>
682`,
683
684		"empty footnote[^]\n\n[^]: fn text",
685		"<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",
686	}
687
688	doTestsInlineParam(t, tests, EXTENSION_FOOTNOTES, 0)
689}