bluefeather 0.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. data/Rakefile.rb +168 -0
  2. data/bin/bluefeather +4 -0
  3. data/doc/author-and-license.bfdoc +16 -0
  4. data/doc/base.css +135 -0
  5. data/doc/basic-usage.bfdoc +265 -0
  6. data/doc/black.css +130 -0
  7. data/doc/class-reference.bfdoc +105 -0
  8. data/doc/difference.bfdoc +63 -0
  9. data/doc/en/author-and-license.bfdoc +20 -0
  10. data/doc/en/base.css +136 -0
  11. data/doc/en/basic-usage.bfdoc +266 -0
  12. data/doc/en/black.css +130 -0
  13. data/doc/en/class-reference.bfdoc +6 -0
  14. data/doc/en/difference.bfdoc +72 -0
  15. data/doc/en/format-extension.bfdoc +324 -0
  16. data/doc/en/index.bfdoc +41 -0
  17. data/doc/en/metadata-reference.bfdoc +7 -0
  18. data/doc/format-extension.bfdoc +325 -0
  19. data/doc/index.bfdoc +36 -0
  20. data/doc/metadata-reference.bfdoc +86 -0
  21. data/lib/bluefeather.rb +1872 -0
  22. data/lib/bluefeather/cui.rb +207 -0
  23. data/license/gpl-2.0.txt +339 -0
  24. data/license/gpl.ja.txt +416 -0
  25. data/original-tests/00_Class.tests.rb +42 -0
  26. data/original-tests/05_Markdown.tests.rb +1530 -0
  27. data/original-tests/10_Bug.tests.rb +44 -0
  28. data/original-tests/15_Contrib.tests.rb +130 -0
  29. data/original-tests/bftestcase.rb +278 -0
  30. data/original-tests/data/antsugar.txt +34 -0
  31. data/original-tests/data/ml-announce.txt +17 -0
  32. data/original-tests/data/re-overflow.txt +67 -0
  33. data/original-tests/data/re-overflow2.txt +281 -0
  34. data/readme_en.txt +37 -0
  35. data/readme_ja.txt +33 -0
  36. data/spec/auto-link.rb +100 -0
  37. data/spec/code-block.rb +91 -0
  38. data/spec/dl.rb +182 -0
  39. data/spec/escape-char.rb +18 -0
  40. data/spec/footnote.rb +34 -0
  41. data/spec/header-id.rb +38 -0
  42. data/spec/lib/common.rb +103 -0
  43. data/spec/table.rb +70 -0
  44. data/spec/toc.rb +64 -0
  45. data/spec/warning.rb +61 -0
  46. metadata +99 -0
@@ -0,0 +1,1530 @@
1
+ #!/usr/bin/ruby
2
+ #
3
+ # Test case for BlueFeather Markdown transforms.
4
+ # $Id: TEMPLATE.rb.tpl,v 1.2 2003/09/11 04:59:51 deveiant Exp $
5
+ #
6
+ # Copyright (c) 2004 The FaerieMUD Consortium, 2009 Dice.
7
+ #
8
+ # Changes: [2009-02-14] adapt to BlueFeather
9
+
10
+ if !defined?( BlueFeather ) || !defined?( BlueFeather::TestCase )
11
+ basedir = File::dirname( __FILE__ )
12
+ require File::join( basedir, 'bftestcase' )
13
+ end
14
+
15
+
16
+ ### This test case tests ...
17
+ class SubfunctionsTestCase < BlueFeather::TestCase
18
+
19
+ ### Test email address output
20
+ Emails = %w[
21
+ address@example.com
22
+ foo-list-admin@bar.com
23
+ fu@bar.COM
24
+ baz@ruby-lang.org
25
+ foo-tim-bazzle@bar-hop.co.uk
26
+ littlestar@twinkle.twinkle.band.CO.ZA
27
+ ll@lll.lllll.ll
28
+ Ull@Ulll.Ulllll.ll
29
+ UUUU1@UU1.UU1UUU.UU
30
+ l@ll.ll
31
+ Ull.Ullll@llll.ll
32
+ Ulll-Ull.Ulllll@ll.ll
33
+ 1@111.ll
34
+ ]
35
+ # I can't see a way to handle IDNs clearly yet, so these will have to wait.
36
+ # info@�ko.de
37
+ # jemand@b�ro.de
38
+ # irgendwo-interre�ant@d�gta.se
39
+ #]
40
+
41
+ def test_10_email_address
42
+ printTestHeader "BlueFeather: Inline email address"
43
+ rval = match = nil
44
+
45
+ Emails.each {|addr|
46
+ assert_nothing_raised {
47
+ rval = BlueFeather.parse( "<#{addr}>" )
48
+ }
49
+
50
+ match = %r{<p><a href="([^\"]+)">[^<]+</a></p>}.match( rval )
51
+ assert_not_nil match, "Match against output #{rval}"
52
+ assert_equal "mailto:#{addr}", decode( match[1] )
53
+ }
54
+ end
55
+
56
+
57
+ def decode( str )
58
+ str.gsub( /&#(x[a-f0-9]+|\d{3});/i ) {|match|
59
+ code = $1
60
+ debugMsg "Decoding %p" % code
61
+
62
+ case code
63
+ when /^x([a-f0-9]+)/i
64
+ debugMsg " (hex) = %p" % $1.to_i(16).chr
65
+ $1.to_i(16).chr
66
+ when /\d{3}/
67
+ debugMsg " (oct) = %p" % code.to_i.chr
68
+ code.to_i.chr
69
+ else
70
+ raise "Hmmm... malformed entity %p" % code
71
+ end
72
+ }
73
+ end
74
+
75
+
76
+
77
+ #################################################################
78
+ ### A U T O - G E N E R A T E D T E S T S
79
+ #################################################################
80
+
81
+ # Parse the data section into a hash of test specifications
82
+ TestSets = {}
83
+ begin
84
+ seenEnd = false
85
+ inMetaSection = true
86
+ inInputSection = true
87
+ section, description, input, output = '', '', '', ''
88
+ linenum = 0
89
+
90
+ # Read this file, skipping lines until the __END__ token. Then start
91
+ # reading the tests.
92
+ File::foreach( __FILE__ ) {|line|
93
+ linenum += 1
94
+ if /^__END__/ =~ line then seenEnd = true; next end
95
+ debugMsg "#{linenum}: #{line.chomp}"
96
+ next unless seenEnd
97
+
98
+ # Start off in the meta section, which has sections and
99
+ # descriptions.
100
+ if inMetaSection
101
+
102
+ case line
103
+
104
+ # Left angles switch into data section for the current section
105
+ # and description.
106
+ when /^<<</
107
+ inMetaSection = false
108
+ next
109
+
110
+ # Section headings look like:
111
+ # ### [Code blocks]
112
+ when /^### \[([^\]]+)\]/
113
+ section = $1.chomp
114
+ TestSets[ section ] ||= {}
115
+
116
+ # Descriptions look like:
117
+ # # Para plus code block
118
+ when /^# (.*)/
119
+ description = $1.chomp
120
+ TestSets[ section ][ description ] ||= {
121
+ :line => linenum,
122
+ :sets => [],
123
+ }
124
+
125
+ end
126
+
127
+ # Data section has input and expected output parts
128
+ else
129
+
130
+ case line
131
+
132
+ # Right angles terminate a data section, at which point we
133
+ # should have enough data to add a test.
134
+ when /^>>>/
135
+ TestSets[ section ][ description ][:sets] << [ input.chomp, output.chomp ]
136
+
137
+ inMetaSection = true
138
+ inInputSection = true
139
+ input = ''; output = ''
140
+
141
+ # 3-Dashed divider with text divides input from output
142
+ when /^--- (.+)/
143
+ inInputSection = false
144
+
145
+ # Anything else adds to either input or output
146
+ else
147
+ if inInputSection
148
+ input += line
149
+ else
150
+ output += line
151
+ end
152
+ end
153
+ end
154
+ }
155
+ end
156
+
157
+ debugMsg "Test sets: %p" % TestSets
158
+
159
+ # Auto-generate tests out of the test specifications
160
+ TestSets.each {|sname, section|
161
+
162
+ # Generate a test method for each section
163
+ section.each do |desc, test|
164
+ methname = "test_%03d_%s" %
165
+ [ test[:line], desc.gsub(/\W+/, '_').downcase ]
166
+
167
+ # Header
168
+ code = %{
169
+ def #{methname}
170
+ printTestHeader "BlueFeather: #{desc}"
171
+ rval = nil
172
+ }
173
+
174
+ # An assertion for each input/output pair
175
+ test[:sets].each {|input, output|
176
+ code << %{
177
+ assert_nothing_raised {
178
+ parser = BlueFeather::Parser.new
179
+ parser.use_header_id = false
180
+ parser.display_warnings = false
181
+ rval = parser.parse(%p)
182
+ }
183
+ assert_equal %p, rval
184
+
185
+ } % [ input, output ]
186
+ }
187
+
188
+ code << %{
189
+ end
190
+ }
191
+
192
+
193
+ debugMsg "--- %s [%s]:\n%s\n---\n" % [sname, desc, code]
194
+ eval code
195
+ end
196
+
197
+ }
198
+
199
+ end
200
+
201
+
202
+ __END__
203
+
204
+ ### [Paragraphs and Line Breaks]
205
+
206
+ # Paragraphs
207
+ <<<
208
+ This is some stuff that should all be
209
+ put in one paragraph
210
+ even though
211
+ it occurs over several lines.
212
+
213
+ And this is a another
214
+ one.
215
+ --- Should become:
216
+ <p>This is some stuff that should all be
217
+ put in one paragraph
218
+ even though
219
+ it occurs over several lines.</p>
220
+
221
+ <p>And this is a another
222
+ one.</p>
223
+ >>>
224
+
225
+ # Line breaks
226
+ <<<
227
+ Mostly the same kind of thing
228
+ with two spaces at the end
229
+ of each line
230
+ should result in
231
+ line breaks, though.
232
+
233
+ And this is a another
234
+ one.
235
+ --- Should become:
236
+ <p>Mostly the same kind of thing<br />
237
+ with two spaces at the end<br />
238
+ of each line<br />
239
+ should result in<br />
240
+ line breaks, though.</p>
241
+
242
+ <p>And this is a another<br />
243
+ one.</p>
244
+ >>>
245
+
246
+ # Escaping special characters
247
+ <<<
248
+ The left shift operator, which is written as <<, is often used & greatly admired.
249
+ --- Should become:
250
+ <p>The left shift operator, which is written as &lt;&lt;, is often used &amp; greatly admired.</p>
251
+ >>>
252
+
253
+ # Preservation of named entities
254
+ <<<
255
+ The left shift operator, which is written as &lt;&lt;, is often used &amp; greatly admired.
256
+ --- Should become:
257
+ <p>The left shift operator, which is written as &lt;&lt;, is often used &amp; greatly admired.</p>
258
+ >>>
259
+
260
+ # Preservation of decimal-encoded entities
261
+ <<<
262
+ The left shift operator, which is written as &#060;&#060;, is often used &#038; greatly admired.
263
+ --- Should become:
264
+ <p>The left shift operator, which is written as &#060;&#060;, is often used &#038; greatly admired.</p>
265
+ >>>
266
+
267
+ # Preservation of hex-encoded entities
268
+ <<<
269
+ The left shift operator, which is written as &#x3c;&#x3c;, is often used &#x26; greatly admired.
270
+ --- Should become:
271
+ <p>The left shift operator, which is written as &#x3c;&#x3c;, is often used &#x26; greatly admired.</p>
272
+ >>>
273
+
274
+ # Inline HTML - table tags
275
+ <<<
276
+ This is a regular paragraph.
277
+
278
+ <table>
279
+ <tr>
280
+ <td>Foo</td>
281
+ </tr>
282
+ </table>
283
+
284
+ This is another regular paragraph.
285
+ --- Should become:
286
+ <p>This is a regular paragraph.</p>
287
+
288
+ <table>
289
+ <tr>
290
+ <td>Foo</td>
291
+ </tr>
292
+ </table>
293
+
294
+ <p>This is another regular paragraph.</p>
295
+ >>>
296
+
297
+ # Inline HTML - div tags
298
+ <<<
299
+ This is a regular paragraph.
300
+
301
+ <div>
302
+ Something
303
+ </div>
304
+ Something else.
305
+ --- Should become:
306
+ <p>This is a regular paragraph.</p>
307
+
308
+ <div>
309
+ Something
310
+ </div>
311
+
312
+ <p>Something else.</p>
313
+ >>>
314
+
315
+
316
+ # Inline HTML - Plain HR
317
+ <<<
318
+ This is a regular paragraph.
319
+
320
+ <hr />
321
+
322
+ Something else.
323
+ --- Should become:
324
+ <p>This is a regular paragraph.</p>
325
+
326
+ <hr />
327
+
328
+ <p>Something else.</p>
329
+ >>>
330
+
331
+
332
+ # Inline HTML - Fancy HR
333
+ <<<
334
+ This is a regular paragraph.
335
+
336
+ <hr class="publishers-mark" id="first-hrule" />
337
+
338
+ Something else.
339
+ --- Should become:
340
+ <p>This is a regular paragraph.</p>
341
+
342
+ <hr class="publishers-mark" id="first-hrule" />
343
+
344
+ <p>Something else.</p>
345
+ >>>
346
+
347
+
348
+ # Inline HTML - Iframe
349
+ <<<
350
+ This is a regular paragraph.
351
+
352
+ <iframe src="foo.html" id="foo-frame"></iframe>
353
+
354
+ Something else.
355
+ --- Should become:
356
+ <p>This is a regular paragraph.</p>
357
+
358
+ <iframe src="foo.html" id="foo-frame"></iframe>
359
+
360
+ <p>Something else.</p>
361
+ >>>
362
+
363
+
364
+ # Inline HTML - mathml
365
+ <<<
366
+ Examples
367
+ --------
368
+
369
+ Now that we have met some of the key players, it is time to see what we can
370
+ do. Here are some examples and comments which illustrate the use of the basic
371
+ layout and token elements. Consider the expression x2 + 4x + 4 = 0. A basic
372
+ MathML presentation encoding for this would be:
373
+
374
+ <math>
375
+ <mrow>
376
+ <msup>
377
+ <mi>x</mi>
378
+ <mn>2</mn>
379
+ </msup>
380
+ <mo>+</mo>
381
+ <mn>4</mn>
382
+ <mi>x</mi>
383
+ <mo>+</mo>
384
+ <mn>4</mn>
385
+ <mo>=</mo>
386
+ <mn>0</mn>
387
+ </mrow>
388
+ </math>
389
+
390
+ This encoding will display as you would expect. However, if we were interested
391
+ in reusing this expression in unknown situations, we would likely want to spend
392
+ a little more effort analyzing and encoding the logical expression structure.
393
+
394
+ --- Should become:
395
+ <h2>Examples</h2>
396
+
397
+ <p>Now that we have met some of the key players, it is time to see what we can
398
+ do. Here are some examples and comments which illustrate the use of the basic
399
+ layout and token elements. Consider the expression x2 + 4x + 4 = 0. A basic
400
+ MathML presentation encoding for this would be:</p>
401
+
402
+ <math>
403
+ <mrow>
404
+ <msup>
405
+ <mi>x</mi>
406
+ <mn>2</mn>
407
+ </msup>
408
+ <mo>+</mo>
409
+ <mn>4</mn>
410
+ <mi>x</mi>
411
+ <mo>+</mo>
412
+ <mn>4</mn>
413
+ <mo>=</mo>
414
+ <mn>0</mn>
415
+ </mrow>
416
+ </math>
417
+
418
+ <p>This encoding will display as you would expect. However, if we were interested
419
+ in reusing this expression in unknown situations, we would likely want to spend
420
+ a little more effort analyzing and encoding the logical expression structure.</p>
421
+ >>>
422
+
423
+
424
+ # Span-level HTML
425
+ <<<
426
+ This is some stuff with a <span class="foo">spanned bit of text</span> in
427
+ it. And <del>this *should* be a bit of deleted text</del> which should be
428
+ preserved, and part of it emphasized.
429
+ --- Should become:
430
+ <p>This is some stuff with a <span class="foo">spanned bit of text</span> in
431
+ it. And <del>this <em>should</em> be a bit of deleted text</del> which should be
432
+ preserved, and part of it emphasized.</p>
433
+ >>>
434
+
435
+ # Inline HTML (Case-sensitivity)
436
+ <<<
437
+ This is a regular paragraph.
438
+
439
+ <TABLE>
440
+ <TR>
441
+ <TD>Foo</TD>
442
+ </TR>
443
+ </TABLE>
444
+
445
+ This is another regular paragraph.
446
+ --- Should become:
447
+ <p>This is a regular paragraph.</p>
448
+
449
+ <TABLE>
450
+ <TR>
451
+ <TD>Foo</TD>
452
+ </TR>
453
+ </TABLE>
454
+
455
+ <p>This is another regular paragraph.</p>
456
+ >>>
457
+
458
+ # Span-level HTML (Case-sensitivity)
459
+ <<<
460
+ This is some stuff with a <SPAN CLASS="foo">spanned bit of text</SPAN> in
461
+ it. And <DEL>this *should* be a bit of deleted text</DEL> which should be
462
+ preserved, and part of it emphasized.
463
+ --- Should become:
464
+ <p>This is some stuff with a <SPAN CLASS="foo">spanned bit of text</SPAN> in
465
+ it. And <DEL>this <em>should</em> be a bit of deleted text</DEL> which should be
466
+ preserved, and part of it emphasized.</p>
467
+ >>>
468
+
469
+
470
+
471
+ ### [Code spans]
472
+
473
+ # Single backtick
474
+ <<<
475
+ Making `code` work for you
476
+ --- Should become:
477
+ <p>Making <code>code</code> work for you</p>
478
+ >>>
479
+
480
+ # Literal backtick with doubling
481
+ <<<
482
+ Making `` `code` `` work for you
483
+ --- Should become:
484
+ <p>Making <code>`code`</code> work for you</p>
485
+ >>>
486
+
487
+ # Many repetitions
488
+ <<<
489
+ Making `````code````` work for you
490
+ --- Should become:
491
+ <p>Making <code>code</code> work for you</p>
492
+ >>>
493
+
494
+ # Two in a row
495
+ <<<
496
+ This `thing` should be `two` spans.
497
+ --- Should become:
498
+ <p>This <code>thing</code> should be <code>two</code> spans.</p>
499
+ >>>
500
+
501
+ # At the beginning of a newline
502
+ <<<
503
+ I should think that the
504
+ `tar` command would be universal.
505
+ --- Should become:
506
+ <p>I should think that the
507
+ <code>tar</code> command would be universal.</p>
508
+ >>>
509
+
510
+ # Entity escaping
511
+ <<<
512
+ The left angle-bracket (`&lt;`) can also be written as a decimal-encoded
513
+ (`&#060;`) or hex-encoded (`&#x3c;`) entity.
514
+ --- Should become:
515
+ <p>The left angle-bracket (<code>&amp;lt;</code>) can also be written as a decimal-encoded
516
+ (<code>&amp;#060;</code>) or hex-encoded (<code>&amp;#x3c;</code>) entity.</p>
517
+ >>>
518
+
519
+ # At the beginning of a document (Bug #525)
520
+ <<<
521
+ `world` views
522
+ --- Should become:
523
+ <p><code>world</code> views</p>
524
+ >>>
525
+
526
+
527
+
528
+
529
+ ### [Code blocks]
530
+
531
+ # Para plus code block (literal tab)
532
+ <<<
533
+ This is a chunk of code:
534
+
535
+ some.code > some.other_code
536
+
537
+ Some stuff.
538
+ --- Should become:
539
+ <p>This is a chunk of code:</p>
540
+
541
+ <pre><code>some.code &gt; some.other_code
542
+ </code></pre>
543
+
544
+ <p>Some stuff.</p>
545
+ >>>
546
+
547
+ # Para plus code block (literal tab, no colon)
548
+ <<<
549
+ This is a chunk of code
550
+
551
+ some.code > some.other_code
552
+
553
+ Some stuff.
554
+ --- Should become:
555
+ <p>This is a chunk of code</p>
556
+
557
+ <pre><code>some.code &gt; some.other_code
558
+ </code></pre>
559
+
560
+ <p>Some stuff.</p>
561
+ >>>
562
+
563
+ # Para plus code block (tab-width spaces)
564
+ <<<
565
+ This is a chunk of code:
566
+
567
+ some.code > some.other_code
568
+
569
+ Some stuff.
570
+ --- Should become:
571
+ <p>This is a chunk of code:</p>
572
+
573
+ <pre><code>some.code &gt; some.other_code
574
+ </code></pre>
575
+
576
+ <p>Some stuff.</p>
577
+ >>>
578
+
579
+ # Para plus code block (tab-width spaces, no colon)
580
+ <<<
581
+ This is a chunk of code
582
+
583
+ some.code > some.other_code
584
+
585
+ Some stuff.
586
+ --- Should become:
587
+ <p>This is a chunk of code</p>
588
+
589
+ <pre><code>some.code &gt; some.other_code
590
+ </code></pre>
591
+
592
+ <p>Some stuff.</p>
593
+ >>>
594
+
595
+ # Colon with preceeding space
596
+ <<<
597
+ A regular paragraph, without a colon. :
598
+
599
+ This is a code block.
600
+
601
+ Some stuff.
602
+ --- Should become:
603
+ <p>A regular paragraph, without a colon. :</p>
604
+
605
+ <pre><code>This is a code block.
606
+ </code></pre>
607
+
608
+ <p>Some stuff.</p>
609
+ >>>
610
+
611
+ # Single colon
612
+ <<<
613
+ :
614
+
615
+ some.code > some.other_code
616
+
617
+ Some stuff.
618
+ --- Should become:
619
+ <p>:</p>
620
+
621
+ <pre><code>some.code &gt; some.other_code
622
+ </code></pre>
623
+
624
+ <p>Some stuff.</p>
625
+ >>>
626
+
627
+ # Preserve leading whitespace (Bug #541)
628
+ <<<
629
+ Examples:
630
+
631
+ # (Waste character because first line is flush left !!!)
632
+ # Example script1
633
+ x = 1
634
+ x += 1
635
+ puts x
636
+
637
+ Some stuff.
638
+ --- Should become:
639
+ <p>Examples:</p>
640
+
641
+ <pre><code> # (Waste character because first line is flush left !!!)
642
+ # Example script1
643
+ x = 1
644
+ x += 1
645
+ puts x
646
+ </code></pre>
647
+
648
+ <p>Some stuff.</p>
649
+ >>>
650
+
651
+
652
+ ### [Horizontal Rules]
653
+
654
+ # Hrule 1
655
+ <<<
656
+ * * *
657
+ --- Should become:
658
+ <hr />
659
+ >>>
660
+
661
+ # Hrule 2
662
+ <<<
663
+ ***
664
+ --- Should become:
665
+ <hr />
666
+ >>>
667
+
668
+ # Hrule 3
669
+ <<<
670
+ *****
671
+ --- Should become:
672
+ <hr />
673
+ >>>
674
+
675
+ # Hrule 4
676
+ <<<
677
+ - - -
678
+ --- Should become:
679
+ <hr />
680
+ >>>
681
+
682
+ # Hrule 5
683
+ <<<
684
+ ---------------------------------------
685
+ --- Should become:
686
+ <hr />
687
+ >>>
688
+
689
+
690
+ ### [Titles]
691
+
692
+ # setext-style h1
693
+ <<<
694
+ Title Text
695
+ =
696
+ --- Should become:
697
+ <h1>Title Text</h1>
698
+ >>>
699
+
700
+ <<<
701
+ Title Text
702
+ ===
703
+ --- Should become:
704
+ <h1>Title Text</h1>
705
+ >>>
706
+
707
+ <<<
708
+ Title Text
709
+ ==========
710
+ --- Should become:
711
+ <h1>Title Text</h1>
712
+ >>>
713
+
714
+ # setext-style h2
715
+ <<<
716
+ Title Text
717
+ -
718
+ --- Should become:
719
+ <h2>Title Text</h2>
720
+ >>>
721
+
722
+ <<<
723
+ Title Text
724
+ ---
725
+ --- Should become:
726
+ <h2>Title Text</h2>
727
+ >>>
728
+
729
+ <<<
730
+ Title Text
731
+ ----------
732
+ --- Should become:
733
+ <h2>Title Text</h2>
734
+ >>>
735
+
736
+ # ATX-style h1
737
+ <<<
738
+ # Title Text
739
+ --- Should become:
740
+ <h1>Title Text</h1>
741
+ >>>
742
+
743
+ <<<
744
+ # Title Text #
745
+ --- Should become:
746
+ <h1>Title Text</h1>
747
+ >>>
748
+
749
+ <<<
750
+ # Title Text ###
751
+ --- Should become:
752
+ <h1>Title Text</h1>
753
+ >>>
754
+
755
+ <<<
756
+ # Title Text #####
757
+ --- Should become:
758
+ <h1>Title Text</h1>
759
+ >>>
760
+
761
+ # ATX-style h2
762
+ <<<
763
+ ## Title Text
764
+ --- Should become:
765
+ <h2>Title Text</h2>
766
+ >>>
767
+
768
+ <<<
769
+ ## Title Text #
770
+ --- Should become:
771
+ <h2>Title Text</h2>
772
+ >>>
773
+
774
+ <<<
775
+ ## Title Text ###
776
+ --- Should become:
777
+ <h2>Title Text</h2>
778
+ >>>
779
+
780
+ <<<
781
+ ## Title Text #####
782
+ --- Should become:
783
+ <h2>Title Text</h2>
784
+ >>>
785
+
786
+ # ATX-style h3
787
+ <<<
788
+ ### Title Text
789
+ --- Should become:
790
+ <h3>Title Text</h3>
791
+ >>>
792
+
793
+ <<<
794
+ ### Title Text #
795
+ --- Should become:
796
+ <h3>Title Text</h3>
797
+ >>>
798
+
799
+ <<<
800
+ ### Title Text ###
801
+ --- Should become:
802
+ <h3>Title Text</h3>
803
+ >>>
804
+
805
+ <<<
806
+ ### Title Text #####
807
+ --- Should become:
808
+ <h3>Title Text</h3>
809
+ >>>
810
+
811
+ # ATX-style h4
812
+ <<<
813
+ #### Title Text
814
+ --- Should become:
815
+ <h4>Title Text</h4>
816
+ >>>
817
+
818
+ <<<
819
+ #### Title Text #
820
+ --- Should become:
821
+ <h4>Title Text</h4>
822
+ >>>
823
+
824
+ <<<
825
+ #### Title Text ###
826
+ --- Should become:
827
+ <h4>Title Text</h4>
828
+ >>>
829
+
830
+ <<<
831
+ #### Title Text #####
832
+ --- Should become:
833
+ <h4>Title Text</h4>
834
+ >>>
835
+
836
+ # ATX-style h5
837
+ <<<
838
+ ##### Title Text
839
+ --- Should become:
840
+ <h5>Title Text</h5>
841
+ >>>
842
+
843
+ <<<
844
+ ##### Title Text #
845
+ --- Should become:
846
+ <h5>Title Text</h5>
847
+ >>>
848
+
849
+ <<<
850
+ ##### Title Text ###
851
+ --- Should become:
852
+ <h5>Title Text</h5>
853
+ >>>
854
+
855
+ <<<
856
+ ##### Title Text #####
857
+ --- Should become:
858
+ <h5>Title Text</h5>
859
+ >>>
860
+
861
+ # ATX-style h6
862
+ <<<
863
+ ###### Title Text
864
+ --- Should become:
865
+ <h6>Title Text</h6>
866
+ >>>
867
+
868
+ <<<
869
+ ###### Title Text #
870
+ --- Should become:
871
+ <h6>Title Text</h6>
872
+ >>>
873
+
874
+ <<<
875
+ ###### Title Text ###
876
+ --- Should become:
877
+ <h6>Title Text</h6>
878
+ >>>
879
+
880
+ <<<
881
+ ###### Title Text #####
882
+ --- Should become:
883
+ <h6>Title Text</h6>
884
+ >>>
885
+
886
+
887
+ ### [Blockquotes]
888
+
889
+ # Regular 1-level blockquotes
890
+ <<<
891
+ > Email-style angle brackets
892
+ > are used for blockquotes.
893
+ --- Should become:
894
+ <blockquote>
895
+ <p>Email-style angle brackets
896
+ are used for blockquotes.</p>
897
+ </blockquote>
898
+ >>>
899
+
900
+ # Doubled blockquotes
901
+ <<<
902
+ > > And, they can be nested.
903
+ --- Should become:
904
+ <blockquote>
905
+ <blockquote>
906
+ <p>And, they can be nested.</p>
907
+ </blockquote>
908
+ </blockquote>
909
+ >>>
910
+
911
+ # Nested blockquotes
912
+ <<<
913
+ > Email-style angle brackets
914
+ > are used for blockquotes.
915
+
916
+ > > And, they can be nested.
917
+ --- Should become:
918
+ <blockquote>
919
+ <p>Email-style angle brackets
920
+ are used for blockquotes.</p>
921
+
922
+ <blockquote>
923
+ <p>And, they can be nested.</p>
924
+ </blockquote>
925
+ </blockquote>
926
+ >>>
927
+
928
+ # Lazy blockquotes
929
+ <<<
930
+ > This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet,
931
+ consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus.
932
+ Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus.
933
+
934
+ > Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse
935
+ id sem consectetuer libero luctus adipiscing.
936
+ --- Should become:
937
+ <blockquote>
938
+ <p>This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet,
939
+ consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus.
940
+ Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus.</p>
941
+
942
+ <p>Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse
943
+ id sem consectetuer libero luctus adipiscing.</p>
944
+ </blockquote>
945
+ >>>
946
+
947
+
948
+ # Blockquotes containing other markdown elements
949
+ <<<
950
+ > ## This is a header.
951
+ >
952
+ > 1. This is the first list item.
953
+ > 2. This is the second list item.
954
+ >
955
+ > Here's some example code:
956
+ >
957
+ > return shell_exec("echo $input | $markdown_script");
958
+ --- Should become:
959
+ <blockquote>
960
+ <h2>This is a header.</h2>
961
+
962
+ <ol>
963
+ <li>This is the first list item.</li>
964
+ <li>This is the second list item.</li>
965
+ </ol>
966
+
967
+ <p>Here's some example code:</p>
968
+
969
+ <pre><code>return shell_exec("echo $input | $markdown_script");
970
+ </code></pre>
971
+ </blockquote>
972
+ >>>
973
+
974
+ # Blockquotes with a <pre> section
975
+ <<<
976
+ > The best approximation of the problem is the following code:
977
+ >
978
+ > <pre>
979
+ > foo + bar; foo.factorize; foo.display
980
+ > </pre>
981
+ >
982
+ > This should result in an error on any little-endian platform.
983
+ --- Should become:
984
+ <blockquote>
985
+ <p>The best approximation of the problem is the following code:</p>
986
+
987
+ <pre>
988
+ foo + bar; foo.factorize; foo.display
989
+ </pre>
990
+
991
+ <p>This should result in an error on any little-endian platform.</p>
992
+ </blockquote>
993
+ >>>
994
+
995
+
996
+
997
+ ### [Images]
998
+
999
+ # Inline image with title
1000
+ <<<
1001
+ ![alt text](/path/img.jpg "Title")
1002
+ --- Should become:
1003
+ <p><img src="/path/img.jpg" alt="alt text" title="Title" /></p>
1004
+ >>>
1005
+
1006
+ # Inline image with title (single-quotes)
1007
+ <<<
1008
+ ![alt text](/path/img.jpg 'Title')
1009
+ --- Should become:
1010
+ <p><img src="/path/img.jpg" alt="alt text" title="Title" /></p>
1011
+ >>>
1012
+
1013
+ # Inline image with title (with embedded quotes)
1014
+ <<<
1015
+ ![alt text](/path/img.jpg 'The "Title" Image')
1016
+ --- Should become:
1017
+ <p><img src="/path/img.jpg" alt="alt text" title="The &quot;Title&quot; Image" /></p>
1018
+ >>>
1019
+
1020
+ # Inline image without title
1021
+ <<<
1022
+ ![alt text](/path/img.jpg)
1023
+ --- Should become:
1024
+ <p><img src="/path/img.jpg" alt="alt text" /></p>
1025
+ >>>
1026
+
1027
+ # Inline image with quoted alt text
1028
+ <<<
1029
+ ![the "alt text"](/path/img.jpg)
1030
+ --- Should become:
1031
+ <p><img src="/path/img.jpg" alt="the &quot;alt text&quot;" /></p>
1032
+ >>>
1033
+
1034
+
1035
+ # Reference image
1036
+ <<<
1037
+ ![alt text][id]
1038
+
1039
+ [id]: /url/to/img.jpg "Title"
1040
+ --- Should become:
1041
+ <p><img src="/url/to/img.jpg" alt="alt text" title="Title" /></p>
1042
+ >>>
1043
+
1044
+
1045
+
1046
+ ### [Emphasis]
1047
+
1048
+ # Emphasis (<em>) with asterisks
1049
+ <<<
1050
+ Use *single splats* for emphasis.
1051
+ --- Should become:
1052
+ <p>Use <em>single splats</em> for emphasis.</p>
1053
+ >>>
1054
+
1055
+ # Emphasis (<em>) with underscores
1056
+ <<<
1057
+ Use *underscores* for emphasis.
1058
+ --- Should become:
1059
+ <p>Use <em>underscores</em> for emphasis.</p>
1060
+ >>>
1061
+
1062
+ # Strong emphasis (<strong>) with asterisks
1063
+ <<<
1064
+ Use **double splats** for more emphasis.
1065
+ --- Should become:
1066
+ <p>Use <strong>double splats</strong> for more emphasis.</p>
1067
+ >>>
1068
+
1069
+ # Strong emphasis (<strong>) with underscores
1070
+ <<<
1071
+ Use __doubled underscores__ for more emphasis.
1072
+ --- Should become:
1073
+ <p>Use <strong>doubled underscores</strong> for more emphasis.</p>
1074
+ >>>
1075
+
1076
+ # Combined emphasis types 1
1077
+ <<<
1078
+ Use *single splats* or _single unders_ for normal emphasis.
1079
+ --- Should become:
1080
+ <p>Use <em>single splats</em> or <em>single unders</em> for normal emphasis.</p>
1081
+ >>>
1082
+
1083
+ # Combined emphasis types 2
1084
+ <<<
1085
+ Use _single unders_ for normal emphasis
1086
+ or __double them__ for strong emphasis.
1087
+ --- Should become:
1088
+ <p>Use <em>single unders</em> for normal emphasis
1089
+ or <strong>double them</strong> for strong emphasis.</p>
1090
+ >>>
1091
+
1092
+ # Emphasis containing escaped metachars
1093
+ <<<
1094
+ You can include literal *\*splats\** by escaping them.
1095
+ --- Should become:
1096
+ <p>You can include literal <em>*splats*</em> by escaping them.</p>
1097
+ >>>
1098
+
1099
+ # Two instances of asterisked emphasis on one line
1100
+ <<<
1101
+ If there's *two* splatted parts on a *single line* it should still work.
1102
+ --- Should become:
1103
+ <p>If there's <em>two</em> splatted parts on a <em>single line</em> it should still work.</p>
1104
+ >>>
1105
+
1106
+ # Two instances of double asterisked emphasis on one line
1107
+ <<<
1108
+ This **doubled** one should **work too**.
1109
+ --- Should become:
1110
+ <p>This <strong>doubled</strong> one should <strong>work too</strong>.</p>
1111
+ >>>
1112
+
1113
+ # Two instances of underscore emphasis on one line
1114
+ <<<
1115
+ If there's _two_ underbarred parts on a _single line_ it should still work.
1116
+ --- Should become:
1117
+ <p>If there's <em>two</em> underbarred parts on a <em>single line</em> it should still work.</p>
1118
+ >>>
1119
+
1120
+ # Two instances of doubled underscore emphasis on one line
1121
+ <<<
1122
+ This __doubled__ one should __work too__.
1123
+ --- Should become:
1124
+ <p>This <strong>doubled</strong> one should <strong>work too</strong>.</p>
1125
+ >>>
1126
+
1127
+ # Initial emphasis (asterisk)
1128
+ <<<
1129
+ *Something* like this should be bold.
1130
+ --- Should become:
1131
+ <p><em>Something</em> like this should be bold.</p>
1132
+ >>>
1133
+
1134
+ # Initial emphasis (underscore)
1135
+ <<<
1136
+ _Something_ like this should be bold.
1137
+ --- Should become:
1138
+ <p><em>Something</em> like this should be bold.</p>
1139
+ >>>
1140
+
1141
+ # Initial strong emphasis (asterisk)
1142
+ <<<
1143
+ **Something** like this should be bold.
1144
+ --- Should become:
1145
+ <p><strong>Something</strong> like this should be bold.</p>
1146
+ >>>
1147
+
1148
+ # Initial strong emphasis (underscore)
1149
+ <<<
1150
+ __Something__ like this should be bold.
1151
+ --- Should become:
1152
+ <p><strong>Something</strong> like this should be bold.</p>
1153
+ >>>
1154
+
1155
+ # Partial-word emphasis (Bug #568)
1156
+ <<<
1157
+ **E**xtended **TURN**
1158
+ --- Should become:
1159
+ <p><strong>E</strong>xtended <strong>TURN</strong></p>
1160
+ >>>
1161
+
1162
+
1163
+
1164
+ ### [Links]
1165
+
1166
+ # Inline link, no title
1167
+ <<<
1168
+ An [example](http://url.com/).
1169
+ --- Should become:
1170
+ <p>An <a href="http://url.com/">example</a>.</p>
1171
+ >>>
1172
+
1173
+ # Inline link with title
1174
+ <<<
1175
+ An [example](http://url.com/ "Check out url.com!").
1176
+ --- Should become:
1177
+ <p>An <a href="http://url.com/" title="Check out url.com!">example</a>.</p>
1178
+ >>>
1179
+
1180
+ # Reference-style link, no title
1181
+ <<<
1182
+ An [example][ex] reference-style link.
1183
+
1184
+ [ex]: http://www.bluefi.com/
1185
+ --- Should become:
1186
+ <p>An <a href="http://www.bluefi.com/">example</a> reference-style link.</p>
1187
+ >>>
1188
+
1189
+ # Reference-style link with quoted title
1190
+ <<<
1191
+ An [example][ex] reference-style link.
1192
+
1193
+ [ex]: http://www.bluefi.com/ "Check out our air."
1194
+ --- Should become:
1195
+ <p>An <a href="http://www.bluefi.com/" title="Check out our air.">example</a> reference-style link.</p>
1196
+ >>>
1197
+
1198
+ # Reference-style link with paren title
1199
+ <<<
1200
+ An [example][ex] reference-style link.
1201
+
1202
+ [ex]: http://www.bluefi.com/ (Check out our air.)
1203
+ --- Should become:
1204
+ <p>An <a href="http://www.bluefi.com/" title="Check out our air.">example</a> reference-style link.</p>
1205
+ >>>
1206
+
1207
+ # Reference-style link with one of each (hehe)
1208
+ <<<
1209
+ An [example][ex] reference-style link.
1210
+
1211
+ [ex]: http://www.bluefi.com/ "Check out our air.)
1212
+ --- Should become:
1213
+ <p>An <a href="http://www.bluefi.com/" title="Check out our air.">example</a> reference-style link.</p>
1214
+ >>>
1215
+
1216
+ " <- For syntax highlighting
1217
+
1218
+ # Reference-style link with intervening space
1219
+ <<<
1220
+ You can split the [linked part] [ex] from
1221
+ the reference part with a single space.
1222
+
1223
+ [ex]: http://www.treefrog.com/ "for some reason"
1224
+ --- Should become:
1225
+ <p>You can split the <a href="http://www.treefrog.com/" title="for some reason">linked part</a> from
1226
+ the reference part with a single space.</p>
1227
+ >>>
1228
+
1229
+ # Reference-style link with intervening space
1230
+ <<<
1231
+ You can split the [linked part]
1232
+ [ex] from the reference part
1233
+ with a newline in case your editor wraps it there, I guess.
1234
+
1235
+ [ex]: http://www.treefrog.com/
1236
+ --- Should become:
1237
+ <p>You can split the <a href="http://www.treefrog.com/">linked part</a> from the reference part
1238
+ with a newline in case your editor wraps it there, I guess.</p>
1239
+ >>>
1240
+
1241
+ # Reference-style anchors
1242
+ <<<
1243
+ I get 10 times more traffic from [Google] [1] than from
1244
+ [Yahoo] [2] or [MSN] [3].
1245
+
1246
+ [1]: http://google.com/ "Google"
1247
+ [2]: http://search.yahoo.com/ "Yahoo Search"
1248
+ [3]: http://search.msn.com/ "MSN Search"
1249
+ --- Should become:
1250
+ <p>I get 10 times more traffic from <a href="http://google.com/" title="Google">Google</a> than from
1251
+ <a href="http://search.yahoo.com/" title="Yahoo Search">Yahoo</a> or <a href="http://search.msn.com/" title="MSN Search">MSN</a>.</p>
1252
+ >>>
1253
+
1254
+ # Implicit name-link shortcut anchors
1255
+ <<<
1256
+ I get 10 times more traffic from [Google][] than from
1257
+ [Yahoo][] or [MSN][].
1258
+
1259
+ [google]: http://google.com/ "Google"
1260
+ [yahoo]: http://search.yahoo.com/ "Yahoo Search"
1261
+ [msn]: http://search.msn.com/ "MSN Search"
1262
+ --- Should become:
1263
+ <p>I get 10 times more traffic from <a href="http://google.com/" title="Google">Google</a> than from
1264
+ <a href="http://search.yahoo.com/" title="Yahoo Search">Yahoo</a> or <a href="http://search.msn.com/" title="MSN Search">MSN</a>.</p>
1265
+ >>>
1266
+
1267
+ # Inline anchors
1268
+ <<<
1269
+ I get 10 times more traffic from [Google](http://google.com/ "Google")
1270
+ than from [Yahoo](http://search.yahoo.com/ "Yahoo Search") or
1271
+ [MSN](http://search.msn.com/ "MSN Search").
1272
+ --- Should become:
1273
+ <p>I get 10 times more traffic from <a href="http://google.com/" title="Google">Google</a>
1274
+ than from <a href="http://search.yahoo.com/" title="Yahoo Search">Yahoo</a> or
1275
+ <a href="http://search.msn.com/" title="MSN Search">MSN</a>.</p>
1276
+ >>>
1277
+
1278
+ # Graceful fail for unclosed brackets (and bug #524)
1279
+ <<<
1280
+ This is just a [bracket opener; it should fail gracefully.
1281
+ --- Should become:
1282
+ <p>This is just a [bracket opener; it should fail gracefully.</p>
1283
+ >>>
1284
+
1285
+ # Unresolved reference-style links (Bug #620)
1286
+ <<<
1287
+ This is an unresolved [url][1].
1288
+ --- Should become:
1289
+ <p>This is an unresolved [url][1].</p>
1290
+ >>>
1291
+
1292
+
1293
+ ### [Auto-links]
1294
+
1295
+ # Plain HTTP link
1296
+ <<<
1297
+ This is a reference to <http://www.FaerieMUD.org/>. You should follow it.
1298
+ --- Should become:
1299
+ <p>This is a reference to <a href="http://www.FaerieMUD.org/">http://www.FaerieMUD.org/</a>. You should follow it.</p>
1300
+ >>>
1301
+
1302
+ # FTP link
1303
+ <<<
1304
+ Why not download your very own chandelier from <ftp://ftp.usuc.edu/pub/foof/mir/>?
1305
+ --- Should become:
1306
+ <p>Why not download your very own chandelier from <a href="ftp://ftp.usuc.edu/pub/foof/mir/">ftp://ftp.usuc.edu/pub/foof/mir/</a>?</p>
1307
+ >>>
1308
+
1309
+
1310
+ ### [Lists]
1311
+
1312
+ # Unordered list
1313
+ <<<
1314
+ * Red
1315
+ * Green
1316
+ * Blue
1317
+ --- Should become:
1318
+ <ul>
1319
+ <li>Red</li>
1320
+ <li>Green</li>
1321
+ <li>Blue</li>
1322
+ </ul>
1323
+ >>>
1324
+
1325
+ # Unordered list w/alt bullets
1326
+ <<<
1327
+ - Red
1328
+ - Green
1329
+ - Blue
1330
+ --- Should become:
1331
+ <ul>
1332
+ <li>Red</li>
1333
+ <li>Green</li>
1334
+ <li>Blue</li>
1335
+ </ul>
1336
+ >>>
1337
+
1338
+ # Unordered list w/alt bullets 2
1339
+ <<<
1340
+ + Red
1341
+ + Green
1342
+ + Blue
1343
+ --- Should become:
1344
+ <ul>
1345
+ <li>Red</li>
1346
+ <li>Green</li>
1347
+ <li>Blue</li>
1348
+ </ul>
1349
+ >>>
1350
+
1351
+ # Unordered list w/mixed bullets
1352
+ <<<
1353
+ + Red
1354
+ - Green
1355
+ * Blue
1356
+ --- Should become:
1357
+ <ul>
1358
+ <li>Red</li>
1359
+ <li>Green</li>
1360
+ <li>Blue</li>
1361
+ </ul>
1362
+ >>>
1363
+
1364
+ # Ordered list
1365
+ <<<
1366
+ 1. Bird
1367
+ 2. McHale
1368
+ 3. Parish
1369
+ --- Should become:
1370
+ <ol>
1371
+ <li>Bird</li>
1372
+ <li>McHale</li>
1373
+ <li>Parish</li>
1374
+ </ol>
1375
+ >>>
1376
+
1377
+ # Ordered list, any numbers
1378
+ <<<
1379
+ 1. Bird
1380
+ 1. McHale
1381
+ 1. Parish
1382
+ --- Should become:
1383
+ <ol>
1384
+ <li>Bird</li>
1385
+ <li>McHale</li>
1386
+ <li>Parish</li>
1387
+ </ol>
1388
+ >>>
1389
+
1390
+ # Ordered list, any numbers 2
1391
+ <<<
1392
+ 3. Bird
1393
+ 1. McHale
1394
+ 8. Parish
1395
+ --- Should become:
1396
+ <ol>
1397
+ <li>Bird</li>
1398
+ <li>McHale</li>
1399
+ <li>Parish</li>
1400
+ </ol>
1401
+ >>>
1402
+
1403
+ # Hanging indents
1404
+ <<<
1405
+ * Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
1406
+ Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi,
1407
+ viverra nec, fringilla in, laoreet vitae, risus.
1408
+ * Donec sit amet nisl. Aliquam semper ipsum sit amet velit.
1409
+ Suspendisse id sem consectetuer libero luctus adipiscing.
1410
+ --- Should become:
1411
+ <ul>
1412
+ <li>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
1413
+ Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi,
1414
+ viverra nec, fringilla in, laoreet vitae, risus.</li>
1415
+ <li>Donec sit amet nisl. Aliquam semper ipsum sit amet velit.
1416
+ Suspendisse id sem consectetuer libero luctus adipiscing.</li>
1417
+ </ul>
1418
+ >>>
1419
+
1420
+ # Lazy indents
1421
+ <<<
1422
+ * Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
1423
+ Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi,
1424
+ viverra nec, fringilla in, laoreet vitae, risus.
1425
+ * Donec sit amet nisl. Aliquam semper ipsum sit amet velit.
1426
+ Suspendisse id sem consectetuer libero luctus adipiscing.
1427
+ --- Should become:
1428
+ <ul>
1429
+ <li>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
1430
+ Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi,
1431
+ viverra nec, fringilla in, laoreet vitae, risus.</li>
1432
+ <li>Donec sit amet nisl. Aliquam semper ipsum sit amet velit.
1433
+ Suspendisse id sem consectetuer libero luctus adipiscing.</li>
1434
+ </ul>
1435
+ >>>
1436
+
1437
+ # Paragraph wrapped list items
1438
+ <<<
1439
+ * Bird
1440
+
1441
+ * Magic
1442
+ --- Should become:
1443
+ <ul>
1444
+ <li><p>Bird</p></li>
1445
+ <li><p>Magic</p></li>
1446
+ </ul>
1447
+ >>>
1448
+
1449
+ # Multi-paragraph list items
1450
+ <<<
1451
+ 1. This is a list item with two paragraphs. Lorem ipsum dolor
1452
+ sit amet, consectetuer adipiscing elit. Aliquam hendrerit
1453
+ mi posuere lectus.
1454
+
1455
+ Vestibulum enim wisi, viverra nec, fringilla in, laoreet
1456
+ vitae, risus. Donec sit amet nisl. Aliquam semper ipsum
1457
+ sit amet velit.
1458
+
1459
+ 2. Suspendisse id sem consectetuer libero luctus adipiscing.
1460
+ --- Should become:
1461
+ <ol>
1462
+ <li><p>This is a list item with two paragraphs. Lorem ipsum dolor
1463
+ sit amet, consectetuer adipiscing elit. Aliquam hendrerit
1464
+ mi posuere lectus.</p>
1465
+
1466
+ <p>Vestibulum enim wisi, viverra nec, fringilla in, laoreet
1467
+ vitae, risus. Donec sit amet nisl. Aliquam semper ipsum
1468
+ sit amet velit.</p></li>
1469
+ <li><p>Suspendisse id sem consectetuer libero luctus adipiscing.</p></li>
1470
+ </ol>
1471
+ >>>
1472
+
1473
+ # Lazy multi-paragraphs
1474
+ <<<
1475
+ * This is a list item with two paragraphs.
1476
+
1477
+ This is the second paragraph in the list item. You're
1478
+ only required to indent the first line. Lorem ipsum dolor
1479
+ sit amet, consectetuer adipiscing elit.
1480
+
1481
+ * Another item in the same list.
1482
+ --- Should become:
1483
+ <ul>
1484
+ <li><p>This is a list item with two paragraphs.</p>
1485
+
1486
+ <p>This is the second paragraph in the list item. You're
1487
+ only required to indent the first line. Lorem ipsum dolor
1488
+ sit amet, consectetuer adipiscing elit.</p></li>
1489
+ <li><p>Another item in the same list.</p></li>
1490
+ </ul>
1491
+ >>>
1492
+
1493
+ # Blockquote in list item
1494
+ <<<
1495
+ * A list item with a blockquote:
1496
+
1497
+ > This is a blockquote
1498
+ > inside a list item.
1499
+ --- Should become:
1500
+ <ul>
1501
+ <li><p>A list item with a blockquote:</p>
1502
+
1503
+ <blockquote>
1504
+ <p>This is a blockquote
1505
+ inside a list item.</p>
1506
+ </blockquote></li>
1507
+ </ul>
1508
+ >>>
1509
+
1510
+ # Code block in list item
1511
+ <<<
1512
+ * A list item with a code block:
1513
+
1514
+ <code goes here>
1515
+ --- Should become:
1516
+ <ul>
1517
+ <li><p>A list item with a code block:</p>
1518
+
1519
+ <pre><code>&lt;code goes here&gt;
1520
+ </code></pre></li>
1521
+ </ul>
1522
+ >>>
1523
+
1524
+ # Backslash-escaped number-period-space
1525
+ <<<
1526
+ 1986\. What a great season.
1527
+ --- Should become:
1528
+ <p>1986. What a great season.</p>
1529
+ >>>
1530
+