parkdown 1.4.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (104) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +68 -0
  3. data/README.markdown +86 -0
  4. data/Rakefile +170 -0
  5. data/bin/parkdown +13 -0
  6. data/ext/extconf.h +3 -0
  7. data/ext/extconf.rb +15 -0
  8. data/ext/markdown.c +104 -0
  9. data/ext/markdown_lib.c +186 -0
  10. data/ext/markdown_lib.h +44 -0
  11. data/ext/markdown_output.c +1275 -0
  12. data/ext/markdown_parser.c +7275 -0
  13. data/ext/markdown_peg.h +90 -0
  14. data/ext/parsing_functions.c +128 -0
  15. data/ext/utility_functions.c +217 -0
  16. data/lib/markdown.rb +1 -0
  17. data/lib/peg_markdown.rb +104 -0
  18. data/test/MarkdownTest_1.0/MarkdownTest.pl +157 -0
  19. data/test/MarkdownTest_1.0/Tests/Amps and angle encoding.html +17 -0
  20. data/test/MarkdownTest_1.0/Tests/Amps and angle encoding.text +21 -0
  21. data/test/MarkdownTest_1.0/Tests/Auto links.html +18 -0
  22. data/test/MarkdownTest_1.0/Tests/Auto links.text +13 -0
  23. data/test/MarkdownTest_1.0/Tests/Backslash escapes.html +102 -0
  24. data/test/MarkdownTest_1.0/Tests/Backslash escapes.text +104 -0
  25. data/test/MarkdownTest_1.0/Tests/Blockquotes with code blocks.html +15 -0
  26. data/test/MarkdownTest_1.0/Tests/Blockquotes with code blocks.text +11 -0
  27. data/test/MarkdownTest_1.0/Tests/Hard-wrapped paragraphs with list-like lines.html +8 -0
  28. data/test/MarkdownTest_1.0/Tests/Hard-wrapped paragraphs with list-like lines.text +8 -0
  29. data/test/MarkdownTest_1.0/Tests/Horizontal rules.html +71 -0
  30. data/test/MarkdownTest_1.0/Tests/Horizontal rules.text +67 -0
  31. data/test/MarkdownTest_1.0/Tests/Inline HTML (Advanced).html +14 -0
  32. data/test/MarkdownTest_1.0/Tests/Inline HTML (Advanced).text +14 -0
  33. data/test/MarkdownTest_1.0/Tests/Inline HTML (Simple).html +72 -0
  34. data/test/MarkdownTest_1.0/Tests/Inline HTML (Simple).text +69 -0
  35. data/test/MarkdownTest_1.0/Tests/Inline HTML comments.html +13 -0
  36. data/test/MarkdownTest_1.0/Tests/Inline HTML comments.text +13 -0
  37. data/test/MarkdownTest_1.0/Tests/Links, inline style.html +9 -0
  38. data/test/MarkdownTest_1.0/Tests/Links, inline style.text +9 -0
  39. data/test/MarkdownTest_1.0/Tests/Links, reference style.html +18 -0
  40. data/test/MarkdownTest_1.0/Tests/Links, reference style.text +31 -0
  41. data/test/MarkdownTest_1.0/Tests/Literal quotes in titles.html +3 -0
  42. data/test/MarkdownTest_1.0/Tests/Literal quotes in titles.text +7 -0
  43. data/test/MarkdownTest_1.0/Tests/Markdown Documentation - Basics.html +314 -0
  44. data/test/MarkdownTest_1.0/Tests/Markdown Documentation - Basics.text +306 -0
  45. data/test/MarkdownTest_1.0/Tests/Markdown Documentation - Syntax.html +942 -0
  46. data/test/MarkdownTest_1.0/Tests/Markdown Documentation - Syntax.text +888 -0
  47. data/test/MarkdownTest_1.0/Tests/Nested blockquotes.html +9 -0
  48. data/test/MarkdownTest_1.0/Tests/Nested blockquotes.text +5 -0
  49. data/test/MarkdownTest_1.0/Tests/Ordered and unordered lists.html +137 -0
  50. data/test/MarkdownTest_1.0/Tests/Ordered and unordered lists.text +122 -0
  51. data/test/MarkdownTest_1.0/Tests/Strong and em together.html +7 -0
  52. data/test/MarkdownTest_1.0/Tests/Strong and em together.text +7 -0
  53. data/test/MarkdownTest_1.0/Tests/Tabs.html +25 -0
  54. data/test/MarkdownTest_1.0/Tests/Tabs.text +21 -0
  55. data/test/MarkdownTest_1.0/Tests/Tidyness.html +8 -0
  56. data/test/MarkdownTest_1.0/Tests/Tidyness.text +5 -0
  57. data/test/MarkdownTest_1.0.3/MarkdownTest.pl +176 -0
  58. data/test/MarkdownTest_1.0.3/Tests/Amps and angle encoding.html +17 -0
  59. data/test/MarkdownTest_1.0.3/Tests/Amps and angle encoding.text +21 -0
  60. data/test/MarkdownTest_1.0.3/Tests/Auto links.html +18 -0
  61. data/test/MarkdownTest_1.0.3/Tests/Auto links.text +13 -0
  62. data/test/MarkdownTest_1.0.3/Tests/Backslash escapes.html +118 -0
  63. data/test/MarkdownTest_1.0.3/Tests/Backslash escapes.text +120 -0
  64. data/test/MarkdownTest_1.0.3/Tests/Blockquotes with code blocks.html +15 -0
  65. data/test/MarkdownTest_1.0.3/Tests/Blockquotes with code blocks.text +11 -0
  66. data/test/MarkdownTest_1.0.3/Tests/Code Blocks.html +18 -0
  67. data/test/MarkdownTest_1.0.3/Tests/Code Blocks.text +14 -0
  68. data/test/MarkdownTest_1.0.3/Tests/Code Spans.html +6 -0
  69. data/test/MarkdownTest_1.0.3/Tests/Code Spans.text +6 -0
  70. data/test/MarkdownTest_1.0.3/Tests/Hard-wrapped paragraphs with list-like lines.html +8 -0
  71. data/test/MarkdownTest_1.0.3/Tests/Hard-wrapped paragraphs with list-like lines.text +8 -0
  72. data/test/MarkdownTest_1.0.3/Tests/Horizontal rules.html +71 -0
  73. data/test/MarkdownTest_1.0.3/Tests/Horizontal rules.text +67 -0
  74. data/test/MarkdownTest_1.0.3/Tests/Inline HTML (Advanced).html +15 -0
  75. data/test/MarkdownTest_1.0.3/Tests/Inline HTML (Advanced).text +15 -0
  76. data/test/MarkdownTest_1.0.3/Tests/Inline HTML (Simple).html +72 -0
  77. data/test/MarkdownTest_1.0.3/Tests/Inline HTML (Simple).text +69 -0
  78. data/test/MarkdownTest_1.0.3/Tests/Inline HTML comments.html +13 -0
  79. data/test/MarkdownTest_1.0.3/Tests/Inline HTML comments.text +13 -0
  80. data/test/MarkdownTest_1.0.3/Tests/Links, inline style.html +11 -0
  81. data/test/MarkdownTest_1.0.3/Tests/Links, inline style.text +12 -0
  82. data/test/MarkdownTest_1.0.3/Tests/Links, reference style.html +52 -0
  83. data/test/MarkdownTest_1.0.3/Tests/Links, reference style.text +71 -0
  84. data/test/MarkdownTest_1.0.3/Tests/Links, shortcut references.html +9 -0
  85. data/test/MarkdownTest_1.0.3/Tests/Links, shortcut references.text +20 -0
  86. data/test/MarkdownTest_1.0.3/Tests/Literal quotes in titles.html +3 -0
  87. data/test/MarkdownTest_1.0.3/Tests/Literal quotes in titles.text +7 -0
  88. data/test/MarkdownTest_1.0.3/Tests/Markdown Documentation - Basics.html +314 -0
  89. data/test/MarkdownTest_1.0.3/Tests/Markdown Documentation - Basics.text +306 -0
  90. data/test/MarkdownTest_1.0.3/Tests/Markdown Documentation - Syntax.html +942 -0
  91. data/test/MarkdownTest_1.0.3/Tests/Markdown Documentation - Syntax.text +888 -0
  92. data/test/MarkdownTest_1.0.3/Tests/Nested blockquotes.html +9 -0
  93. data/test/MarkdownTest_1.0.3/Tests/Nested blockquotes.text +5 -0
  94. data/test/MarkdownTest_1.0.3/Tests/Ordered and unordered lists.html +148 -0
  95. data/test/MarkdownTest_1.0.3/Tests/Ordered and unordered lists.text +131 -0
  96. data/test/MarkdownTest_1.0.3/Tests/Strong and em together.html +7 -0
  97. data/test/MarkdownTest_1.0.3/Tests/Strong and em together.text +7 -0
  98. data/test/MarkdownTest_1.0.3/Tests/Tabs.html +25 -0
  99. data/test/MarkdownTest_1.0.3/Tests/Tabs.text +21 -0
  100. data/test/MarkdownTest_1.0.3/Tests/Tidyness.html +8 -0
  101. data/test/MarkdownTest_1.0.3/Tests/Tidyness.text +5 -0
  102. data/test/benchmark.rb +49 -0
  103. data/test/markdown_test.rb +84 -0
  104. metadata +150 -0
@@ -0,0 +1,9 @@
1
+ <blockquote>
2
+ <p>foo</p>
3
+
4
+ <blockquote>
5
+ <p>bar</p>
6
+ </blockquote>
7
+
8
+ <p>foo</p>
9
+ </blockquote>
@@ -0,0 +1,5 @@
1
+ > foo
2
+ >
3
+ > > bar
4
+ >
5
+ > foo
@@ -0,0 +1,137 @@
1
+ <h2>Unordered</h2>
2
+
3
+ <p>Asterisks tight:</p>
4
+
5
+ <ul>
6
+ <li>asterisk 1</li>
7
+ <li>asterisk 2</li>
8
+ <li>asterisk 3</li>
9
+ </ul>
10
+
11
+ <p>Asterisks loose:</p>
12
+
13
+ <ul>
14
+ <li><p>asterisk 1</p></li>
15
+ <li><p>asterisk 2</p></li>
16
+ <li><p>asterisk 3</p></li>
17
+ </ul>
18
+
19
+ <hr />
20
+
21
+ <p>Pluses tight:</p>
22
+
23
+ <ul>
24
+ <li>Plus 1</li>
25
+ <li>Plus 2</li>
26
+ <li>Plus 3</li>
27
+ </ul>
28
+
29
+ <p>Pluses loose:</p>
30
+
31
+ <ul>
32
+ <li><p>Plus 1</p></li>
33
+ <li><p>Plus 2</p></li>
34
+ <li><p>Plus 3</p></li>
35
+ </ul>
36
+
37
+ <hr />
38
+
39
+ <p>Minuses tight:</p>
40
+
41
+ <ul>
42
+ <li>Minus 1</li>
43
+ <li>Minus 2</li>
44
+ <li>Minus 3</li>
45
+ </ul>
46
+
47
+ <p>Minuses loose:</p>
48
+
49
+ <ul>
50
+ <li><p>Minus 1</p></li>
51
+ <li><p>Minus 2</p></li>
52
+ <li><p>Minus 3</p></li>
53
+ </ul>
54
+
55
+ <h2>Ordered</h2>
56
+
57
+ <p>Tight:</p>
58
+
59
+ <ol>
60
+ <li>First</li>
61
+ <li>Second</li>
62
+ <li>Third</li>
63
+ </ol>
64
+
65
+ <p>and:</p>
66
+
67
+ <ol>
68
+ <li>One</li>
69
+ <li>Two</li>
70
+ <li>Three</li>
71
+ </ol>
72
+
73
+ <p>Loose using tabs:</p>
74
+
75
+ <ol>
76
+ <li><p>First</p></li>
77
+ <li><p>Second</p></li>
78
+ <li><p>Third</p></li>
79
+ </ol>
80
+
81
+ <p>and using spaces:</p>
82
+
83
+ <ol>
84
+ <li><p>One</p></li>
85
+ <li><p>Two</p></li>
86
+ <li><p>Three</p></li>
87
+ </ol>
88
+
89
+ <p>Multiple paragraphs:</p>
90
+
91
+ <ol>
92
+ <li><p>Item 1, graf one.</p>
93
+
94
+ <p>Item 2. graf two. The quick brown fox jumped over the lazy dog's
95
+ back.</p></li>
96
+ <li><p>Item 2.</p></li>
97
+ <li><p>Item 3.</p></li>
98
+ </ol>
99
+
100
+ <h2>Nested</h2>
101
+
102
+ <ul>
103
+ <li>Tab
104
+ <ul>
105
+ <li>Tab
106
+ <ul>
107
+ <li>Tab</li>
108
+ </ul></li>
109
+ </ul></li>
110
+ </ul>
111
+
112
+ <p>Here's another:</p>
113
+
114
+ <ol>
115
+ <li>First</li>
116
+ <li>Second:
117
+ <ul>
118
+ <li>Fee</li>
119
+ <li>Fie</li>
120
+ <li>Foe</li>
121
+ </ul></li>
122
+ <li>Third</li>
123
+ </ol>
124
+
125
+ <p>Same thing but with paragraphs:</p>
126
+
127
+ <ol>
128
+ <li><p>First</p></li>
129
+ <li><p>Second:</p>
130
+
131
+ <ul>
132
+ <li>Fee</li>
133
+ <li>Fie</li>
134
+ <li>Foe</li>
135
+ </ul></li>
136
+ <li><p>Third</p></li>
137
+ </ol>
@@ -0,0 +1,122 @@
1
+ ## Unordered
2
+
3
+ Asterisks tight:
4
+
5
+ * asterisk 1
6
+ * asterisk 2
7
+ * asterisk 3
8
+
9
+
10
+ Asterisks loose:
11
+
12
+ * asterisk 1
13
+
14
+ * asterisk 2
15
+
16
+ * asterisk 3
17
+
18
+ * * *
19
+
20
+ Pluses tight:
21
+
22
+ + Plus 1
23
+ + Plus 2
24
+ + Plus 3
25
+
26
+
27
+ Pluses loose:
28
+
29
+ + Plus 1
30
+
31
+ + Plus 2
32
+
33
+ + Plus 3
34
+
35
+ * * *
36
+
37
+
38
+ Minuses tight:
39
+
40
+ - Minus 1
41
+ - Minus 2
42
+ - Minus 3
43
+
44
+
45
+ Minuses loose:
46
+
47
+ - Minus 1
48
+
49
+ - Minus 2
50
+
51
+ - Minus 3
52
+
53
+
54
+ ## Ordered
55
+
56
+ Tight:
57
+
58
+ 1. First
59
+ 2. Second
60
+ 3. Third
61
+
62
+ and:
63
+
64
+ 1. One
65
+ 2. Two
66
+ 3. Three
67
+
68
+
69
+ Loose using tabs:
70
+
71
+ 1. First
72
+
73
+ 2. Second
74
+
75
+ 3. Third
76
+
77
+ and using spaces:
78
+
79
+ 1. One
80
+
81
+ 2. Two
82
+
83
+ 3. Three
84
+
85
+ Multiple paragraphs:
86
+
87
+ 1. Item 1, graf one.
88
+
89
+ Item 2. graf two. The quick brown fox jumped over the lazy dog's
90
+ back.
91
+
92
+ 2. Item 2.
93
+
94
+ 3. Item 3.
95
+
96
+
97
+
98
+ ## Nested
99
+
100
+ * Tab
101
+ * Tab
102
+ * Tab
103
+
104
+ Here's another:
105
+
106
+ 1. First
107
+ 2. Second:
108
+ * Fee
109
+ * Fie
110
+ * Foe
111
+ 3. Third
112
+
113
+ Same thing but with paragraphs:
114
+
115
+ 1. First
116
+
117
+ 2. Second:
118
+ * Fee
119
+ * Fie
120
+ * Foe
121
+
122
+ 3. Third
@@ -0,0 +1,7 @@
1
+ <p><strong><em>This is strong and em.</em></strong></p>
2
+
3
+ <p>So is <strong><em>this</em></strong> word.</p>
4
+
5
+ <p><strong><em>This is strong and em.</em></strong></p>
6
+
7
+ <p>So is <strong><em>this</em></strong> word.</p>
@@ -0,0 +1,7 @@
1
+ ***This is strong and em.***
2
+
3
+ So is ***this*** word.
4
+
5
+ ___This is strong and em.___
6
+
7
+ So is ___this___ word.
@@ -0,0 +1,25 @@
1
+ <ul>
2
+ <li><p>this is a list item
3
+ indented with tabs</p></li>
4
+ <li><p>this is a list item
5
+ indented with spaces</p></li>
6
+ </ul>
7
+
8
+ <p>Code:</p>
9
+
10
+ <pre><code>this code block is indented by one tab
11
+ </code></pre>
12
+
13
+ <p>And:</p>
14
+
15
+ <pre><code> this code block is indented by two tabs
16
+ </code></pre>
17
+
18
+ <p>And:</p>
19
+
20
+ <pre><code>+ this is an example list item
21
+ indented with tabs
22
+
23
+ + this is an example list item
24
+ indented with spaces
25
+ </code></pre>
@@ -0,0 +1,21 @@
1
+ + this is a list item
2
+ indented with tabs
3
+
4
+ + this is a list item
5
+ indented with spaces
6
+
7
+ Code:
8
+
9
+ this code block is indented by one tab
10
+
11
+ And:
12
+
13
+ this code block is indented by two tabs
14
+
15
+ And:
16
+
17
+ + this is an example list item
18
+ indented with tabs
19
+
20
+ + this is an example list item
21
+ indented with spaces
@@ -0,0 +1,8 @@
1
+ <blockquote>
2
+ <p>A list within a blockquote:</p>
3
+ <ul>
4
+ <li>asterisk 1</li>
5
+ <li>asterisk 2</li>
6
+ <li>asterisk 3</li>
7
+ </ul>
8
+ </blockquote>
@@ -0,0 +1,5 @@
1
+ > A list within a blockquote:
2
+ >
3
+ > * asterisk 1
4
+ > * asterisk 2
5
+ > * asterisk 3
@@ -0,0 +1,176 @@
1
+ #!/usr/bin/perl
2
+
3
+ #
4
+ # MarkdownTester -- Run tests for Markdown implementations
5
+ #
6
+ # Copyright (c) 2004-2005 John Gruber
7
+ # <http://daringfireball.net/projects/markdown/>
8
+ #
9
+
10
+ use strict;
11
+ use warnings;
12
+ use Getopt::Long;
13
+ use Benchmark;
14
+
15
+ our $VERSION = '1.0.2';
16
+ # Sat 24 Dec 2005
17
+
18
+ my $time_start = new Benchmark;
19
+ my $test_dir = "Tests";
20
+ my $script = "./Markdown.pl";
21
+ my $use_tidy = 0;
22
+ my ($flag_version);
23
+
24
+ GetOptions (
25
+ "script=s" => \$script,
26
+ "testdir=s" => \$test_dir,
27
+ "tidy" => \$use_tidy,
28
+ "version" => \$flag_version,
29
+ );
30
+
31
+ if($flag_version) {
32
+ my $progname = $0;
33
+ $progname =~ s{.*/}{};
34
+ die "$progname version $VERSION\n";
35
+ }
36
+
37
+ unless (-d $test_dir) { die "'$test_dir' is not a directory.\n"; }
38
+ unless (-f $script) { die "$script does not exist.\n"; }
39
+ unless (-x $script) { die "$script is not executable.\n"; }
40
+
41
+ my $tests_passed = 0;
42
+ my $tests_failed = 0;
43
+
44
+ TEST:
45
+ foreach my $testfile (glob "$test_dir/*.text") {
46
+ my $testname = $testfile;
47
+ $testname =~ s{.*/(.+)\.text$}{$1}i;
48
+ print "$testname ... ";
49
+
50
+ # Look for a corresponding .html file for each .text file:
51
+ my $resultfile = $testfile;
52
+ $resultfile =~ s{\.text$}{\.html}i;
53
+ unless (-f $resultfile) {
54
+ print "'$resultfile' does not exist.\n\n";
55
+ next TEST;
56
+ }
57
+
58
+ # open(TEST, $testfile) || die("Can't open testfile: $!");
59
+ open(RESULT, $resultfile) || die("Can't open resultfile: $!");
60
+ undef $/;
61
+ # my $t_input = <TEST>;
62
+ my $t_result = <RESULT>;
63
+
64
+ my $t_output = `'$script' '$testfile'`;
65
+
66
+ # Normalize the output and expected result strings:
67
+ $t_result =~ s/\s+\z//; # trim trailing whitespace
68
+ $t_output =~ s/\s+\z//; # trim trailing whitespace
69
+ if ($use_tidy) {
70
+ # Escape the strings, pass them through to CLI tidy tool for tag-level equivalency
71
+ $t_result =~ s{'}{'\\''}g; # escape ' chars for shell
72
+ $t_output =~ s{'}{'\\''}g;
73
+ $t_result = `echo '$t_result' | tidy --show-body-only 1 --quiet 1 --show-warnings 0`;
74
+ $t_output = `echo '$t_output' | tidy --show-body-only 1 --quiet 1 --show-warnings 0`;
75
+ }
76
+
77
+ if ($t_output eq $t_result) {
78
+ print "OK\n";
79
+ $tests_passed++;
80
+ }
81
+ else {
82
+ print "FAILED\n\n";
83
+ # This part added by JM to print diffs
84
+ open(OUT, '>tmp1') or die $!;
85
+ print OUT $t_output or die $!;
86
+ open(RES, '>tmp2') or die $!;
87
+ print RES $t_result or die $!;
88
+ print `diff tmp1 tmp2`;
89
+ close RES;
90
+ close OUT;
91
+ print "\n";
92
+ `rm tmp?`;
93
+ # End of added part
94
+ $tests_failed++;
95
+ }
96
+ }
97
+
98
+ print "\n\n";
99
+ print "$tests_passed passed; $tests_failed failed.\n";
100
+
101
+ my $time_end = new Benchmark;
102
+ my $time_diff = timediff($time_end, $time_start);
103
+ print "Benchmark: ", timestr($time_diff), "\n";
104
+
105
+
106
+ __END__
107
+
108
+ =pod
109
+
110
+ =head1 NAME
111
+
112
+ B<MarkdownTest>
113
+
114
+
115
+ =head1 SYNOPSIS
116
+
117
+ B<MarkdownTest.pl> [ B<--options> ] [ I<file> ... ]
118
+
119
+
120
+ =head1 DESCRIPTION
121
+
122
+
123
+ =head1 OPTIONS
124
+
125
+ Use "--" to end switch parsing. For example, to open a file named "-z", use:
126
+
127
+ MarkdownTest.pl -- -z
128
+
129
+ =over 4
130
+
131
+ =item B<--script>
132
+
133
+ Specify the path to the Markdown script to test. Defaults to
134
+ "./Markdown.pl". Example:
135
+
136
+ ./MarkdownTest.pl --script ./PHP-Markdown/php-markdown
137
+
138
+ =item B<--testdir>
139
+
140
+ Specify the path to a directory containing test data. Defaults to "Tests".
141
+
142
+ =item B<--tidy>
143
+
144
+ Flag to turn on using the command line 'tidy' tool to normalize HTML
145
+ output before comparing script output to the expected test result.
146
+ Assumes that the 'tidy' command is available in your PATH. Defaults to
147
+ off.
148
+
149
+ =back
150
+
151
+
152
+
153
+ =head1 BUGS
154
+
155
+
156
+
157
+ =head1 VERSION HISTORY
158
+
159
+ 1.0 Mon 13 Dec 2004-2005
160
+
161
+ 1.0.1 Mon 19 Sep 2005
162
+
163
+ + Better handling of case when foo.text exists, but foo.html doesn't.
164
+ It now prints a message and moves on, rather than dying.
165
+
166
+
167
+ =head1 COPYRIGHT AND LICENSE
168
+
169
+ Copyright (c) 2004-2005 John Gruber
170
+ <http://daringfireball.net/>
171
+ All rights reserved.
172
+
173
+ This is free software; you may redistribute it and/or modify it under
174
+ the same terms as Perl itself.
175
+
176
+ =cut
@@ -0,0 +1,17 @@
1
+ <p>AT&amp;T has an ampersand in their name.</p>
2
+
3
+ <p>AT&amp;T is another way to write it.</p>
4
+
5
+ <p>This &amp; that.</p>
6
+
7
+ <p>4 &lt; 5.</p>
8
+
9
+ <p>6 > 5.</p>
10
+
11
+ <p>Here's a <a href="http://example.com/?foo=1&amp;bar=2">link</a> with an ampersand in the URL.</p>
12
+
13
+ <p>Here's a link with an amersand in the link text: <a href="http://att.com/" title="AT&amp;T">AT&amp;T</a>.</p>
14
+
15
+ <p>Here's an inline <a href="/script?foo=1&amp;bar=2">link</a>.</p>
16
+
17
+ <p>Here's an inline <a href="/script?foo=1&amp;bar=2">link</a>.</p>
@@ -0,0 +1,21 @@
1
+ AT&T has an ampersand in their name.
2
+
3
+ AT&amp;T is another way to write it.
4
+
5
+ This & that.
6
+
7
+ 4 < 5.
8
+
9
+ 6 > 5.
10
+
11
+ Here's a [link] [1] with an ampersand in the URL.
12
+
13
+ Here's a link with an amersand in the link text: [AT&T] [2].
14
+
15
+ Here's an inline [link](/script?foo=1&bar=2).
16
+
17
+ Here's an inline [link](</script?foo=1&bar=2>).
18
+
19
+
20
+ [1]: http://example.com/?foo=1&bar=2
21
+ [2]: http://att.com/ "AT&T"
@@ -0,0 +1,18 @@
1
+ <p>Link: <a href="http://example.com/">http://example.com/</a>.</p>
2
+
3
+ <p>With an ampersand: <a href="http://example.com/?foo=1&amp;bar=2">http://example.com/?foo=1&amp;bar=2</a></p>
4
+
5
+ <ul>
6
+ <li>In a list?</li>
7
+ <li><a href="http://example.com/">http://example.com/</a></li>
8
+ <li>It should.</li>
9
+ </ul>
10
+
11
+ <blockquote>
12
+ <p>Blockquoted: <a href="http://example.com/">http://example.com/</a></p>
13
+ </blockquote>
14
+
15
+ <p>Auto-links should not occur here: <code>&lt;http://example.com/&gt;</code></p>
16
+
17
+ <pre><code>or here: &lt;http://example.com/&gt;
18
+ </code></pre>
@@ -0,0 +1,13 @@
1
+ Link: <http://example.com/>.
2
+
3
+ With an ampersand: <http://example.com/?foo=1&bar=2>
4
+
5
+ * In a list?
6
+ * <http://example.com/>
7
+ * It should.
8
+
9
+ > Blockquoted: <http://example.com/>
10
+
11
+ Auto-links should not occur here: `<http://example.com/>`
12
+
13
+ or here: <http://example.com/>