public
Description: An implementation of markdown in C, using a PEG grammar
Clone URL: git://github.com/jgm/peg-markdown.git
Search Repo:
Initial commit.
jgm (author)
Fri May 02 16:47:04 -0700 2008
commit  d686afba0380d2887259f3b622e32297dcb0354b
tree    ee38baf3c1996de4399193d52f19c54bf2a0c418
...
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
0
@@ -0,0 +1,64 @@
0
+markdown in c, implemented using PEG grammar
0
+Copyright (c) 2008 John MacFarlane
0
+
0
+Released under GPL:
0
+
0
+This program is free software; you can redistribute it and/or modify
0
+it under the terms of the GNU General Public License as published by
0
+the Free Software Foundation; either version 2 of the License, or
0
+(at your option) any later version.
0
+
0
+This program is distributed in the hope that it will be useful,
0
+but WITHOUT ANY WARRANTY; without even the implied warranty of
0
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
0
+GNU General Public License for more details.
0
+
0
+You should have received a copy of the GNU General Public License
0
+along with this program; if not, write to the Free Software
0
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
0
+
0
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
0
+
0
+peg-0.1.4 (included for convenience - http://piumarta.com/software/peg/)
0
+
0
+Copyright (c) 2007 by Ian Piumarta
0
+All rights reserved.
0
+
0
+Permission is hereby granted, free of charge, to any person obtaining a
0
+copy of this software and associated documentation files (the 'Software'),
0
+to deal in the Software without restriction, including without limitation
0
+the rights to use, copy, modify, merge, publish, distribute, and/or sell
0
+copies of the Software, and to permit persons to whom the Software is
0
+furnished to do so, provided that the above copyright notice(s) and this
0
+permission notice appear in all copies of the Software. Acknowledgement
0
+of the use of this Software in supporting documentation would be
0
+appreciated but is not required.
0
+
0
+THE SOFTWARE IS PROVIDED 'AS IS'. USE ENTIRELY AT YOUR OWN RISK.
0
+
0
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
0
+
0
+my_getopt (included for convenience - http://www.geocities.com/bsittler/)
0
+
0
+Copyright 1997, 2000, 2001, 2002, 2006, Benjamin Sittler
0
+
0
+Permission is hereby granted, free of charge, to any person
0
+obtaining a copy of this software and associated documentation
0
+files (the "Software"), to deal in the Software without
0
+restriction, including without limitation the rights to use, copy,
0
+modify, merge, publish, distribute, sublicense, and/or sell copies
0
+of the Software, and to permit persons to whom the Software is
0
+furnished to do so, subject to the following conditions:
0
+
0
+The above copyright notice and this permission notice shall be
0
+included in all copies or substantial portions of the Software.
0
+
0
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
0
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
0
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
0
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
0
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
0
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
0
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
0
+DEALINGS IN THE SOFTWARE.
0
+
...
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
0
@@ -0,0 +1,30 @@
0
+ALL : markdown
0
+
0
+PROGRAM=markdown
0
+MYGETOPTDIR=my_getopt-1.5
0
+OBJS=$(MYGETOPTDIR)/my_getopt.o
0
+PEGDIR=peg-0.1.4
0
+LEG=$(PEGDIR)/leg
0
+
0
+$(LEG):
0
+ make -C $(PEGDIR)
0
+
0
+%.o : %.c
0
+ $(CC) -c -o $@ $<
0
+
0
+markdown : markdown.c $(OBJS)
0
+ $(CC) -Wall -O3 -ansi -o $@ $(OBJS) $<
0
+
0
+markdown.c : markdown.leg $(LEG)
0
+ $(LEG) -o $@ $<
0
+
0
+.PHONY: clean test
0
+
0
+clean:
0
+ rm markdown.c $(PROGRAM) $(OBJS); \
0
+ make -C $(PEGDIR) spotless
0
+
0
+test: $(PROGRAM)
0
+ cd MarkdownTest_1.0.3; \
0
+ ./MarkdownTest.pl --script=../$(PROGRAM) --tidy
0
+
...
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
0
@@ -0,0 +1,176 @@
0
+#!/usr/bin/perl
0
+
0
+#
0
+# MarkdownTester -- Run tests for Markdown implementations
0
+#
0
+# Copyright (c) 2004-2005 John Gruber
0
+# <http://daringfireball.net/projects/markdown/>
0
+#
0
+
0
+use strict;
0
+use warnings;
0
+use Getopt::Long;
0
+use Benchmark;
0
+
0
+our $VERSION = '1.0.2';
0
+# Sat 24 Dec 2005
0
+
0
+my $time_start = new Benchmark;
0
+my $test_dir = "Tests";
0
+my $script = "./Markdown.pl";
0
+my $use_tidy = 0;
0
+my ($flag_version);
0
+
0
+GetOptions (
0
+ "script=s" => \$script,
0
+ "testdir=s" => \$test_dir,
0
+ "tidy" => \$use_tidy,
0
+ "version" => \$flag_version,
0
+ );
0
+
0
+if($flag_version) {
0
+ my $progname = $0;
0
+ $progname =~ s{.*/}{};
0
+ die "$progname version $VERSION\n";
0
+}
0
+
0
+unless (-d $test_dir) { die "'$test_dir' is not a directory.\n"; }
0
+unless (-f $script) { die "$script does not exist.\n"; }
0
+unless (-x $script) { die "$script is not executable.\n"; }
0
+
0
+my $tests_passed = 0;
0
+my $tests_failed = 0;
0
+
0
+TEST:
0
+foreach my $testfile (glob "$test_dir/*.text") {
0
+ my $testname = $testfile;
0
+ $testname =~ s{.*/(.+)\.text$}{$1}i;
0
+ print "$testname ... ";
0
+
0
+ # Look for a corresponding .html file for each .text file:
0
+ my $resultfile = $testfile;
0
+ $resultfile =~ s{\.text$}{\.html}i;
0
+ unless (-f $resultfile) {
0
+ print "'$resultfile' does not exist.\n\n";
0
+ next TEST;
0
+ }
0
+
0
+ # open(TEST, $testfile) || die("Can't open testfile: $!");
0
+ open(RESULT, $resultfile) || die("Can't open resultfile: $!");
0
+ undef $/;
0
+ # my $t_input = <TEST>;
0
+ my $t_result = <RESULT>;
0
+
0
+ my $t_output = `'$script' '$testfile'`;
0
+
0
+ # Normalize the output and expected result strings:
0
+ $t_result =~ s/\s+\z//; # trim trailing whitespace
0
+ $t_output =~ s/\s+\z//; # trim trailing whitespace
0
+ if ($use_tidy) {
0
+ # Escape the strings, pass them through to CLI tidy tool for tag-level equivalency
0
+ $t_result =~ s{'}{'\\''}g; # escape ' chars for shell
0
+ $t_output =~ s{'}{'\\''}g;
0
+ $t_result = `echo '$t_result' | tidy --show-body-only 1 --quiet 1 --show-warnings 0`;
0
+ $t_output = `echo '$t_output' | tidy --show-body-only 1 --quiet 1 --show-warnings 0`;
0
+ }
0
+
0
+ if ($t_output eq $t_result) {
0
+ print "OK\n";
0
+ $tests_passed++;
0
+ }
0
+ else {
0
+ print "FAILED\n\n";
0
+# This part added by JM to print diffs
0
+ open(OUT, '>tmp1') or die $!;
0
+ print OUT $t_output or die $!;
0
+ open(RES, '>tmp2') or die $!;
0
+ print RES $t_result or die $!;
0
+ print `diff tmp1 tmp2`;
0
+ close RES;
0
+ close OUT;
0
+ print "\n";
0
+ `rm tmp?`;
0
+# End of added part
0
+ $tests_failed++;
0
+ }
0
+}
0
+
0
+print "\n\n";
0
+print "$tests_passed passed; $tests_failed failed.\n";
0
+
0
+my $time_end = new Benchmark;
0
+my $time_diff = timediff($time_end, $time_start);
0
+print "Benchmark: ", timestr($time_diff), "\n";
0
+
0
+
0
+__END__
0
+
0
+=pod
0
+
0
+=head1 NAME
0
+
0
+B<MarkdownTest>
0
+
0
+
0
+=head1 SYNOPSIS
0
+
0
+B<MarkdownTest.pl> [ B<--options> ] [ I<file> ... ]
0
+
0
+
0
+=head1 DESCRIPTION
0
+
0
+
0
+=head1 OPTIONS
0
+
0
+Use "--" to end switch parsing. For example, to open a file named "-z", use:
0
+
0
+ MarkdownTest.pl -- -z
0
+
0
+=over 4
0
+
0
+=item B<--script>
0
+
0
+Specify the path to the Markdown script to test. Defaults to
0
+"./Markdown.pl". Example:
0
+
0
+ ./MarkdownTest.pl --script ./PHP-Markdown/php-markdown
0
+
0
+=item B<--testdir>
0
+
0
+Specify the path to a directory containing test data. Defaults to "Tests".
0
+
0
+=item B<--tidy>
0
+
0
+Flag to turn on using the command line 'tidy' tool to normalize HTML
0
+output before comparing script output to the expected test result.
0
+Assumes that the 'tidy' command is available in your PATH. Defaults to
0
+off.
0
+
0
+=back
0
+
0
+
0
+
0
+=head1 BUGS
0
+
0
+
0
+
0
+=head1 VERSION HISTORY
0
+
0
+1.0 Mon 13 Dec 2004-2005
0
+
0
+1.0.1 Mon 19 Sep 2005
0
+
0
+ + Better handling of case when foo.text exists, but foo.html doesn't.
0
+ It now prints a message and moves on, rather than dying.
0
+
0
+
0
+=head1 COPYRIGHT AND LICENSE
0
+
0
+Copyright (c) 2004-2005 John Gruber
0
+<http://daringfireball.net/>
0
+All rights reserved.
0
+
0
+This is free software; you may redistribute it and/or modify it under
0
+the same terms as Perl itself.
0
+
0
+=cut
...
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
0
@@ -0,0 +1,17 @@
0
+<p>AT&amp;T has an ampersand in their name.</p>
0
+
0
+<p>AT&amp;T is another way to write it.</p>
0
+
0
+<p>This &amp; that.</p>
0
+
0
+<p>4 &lt; 5.</p>
0
+
0
+<p>6 > 5.</p>
0
+
0
+<p>Here's a <a href="http://example.com/?foo=1&amp;bar=2">link</a> with an ampersand in the URL.</p>
0
+
0
+<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>
0
+
0
+<p>Here's an inline <a href="/script?foo=1&amp;bar=2">link</a>.</p>
0
+
0
+<p>Here's an inline <a href="/script?foo=1&amp;bar=2">link</a>.</p>
...
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
0
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
0
@@ -0,0 +1,21 @@
0
+AT&T has an ampersand in their name.
0
+
0
+AT&amp;T is another way to write it.
0
+
0
+This & that.
0
+
0
+4 < 5.
0
+
0
+6 > 5.
0
+
0
+Here's a [link] [1] with an ampersand in the URL.
0
+
0
+Here's a link with an amersand in the link text: [AT&T] [2].
0
+
0
+Here's an inline [link](/script?foo=1&bar=2).
0
+
0
+Here's an inline [link](</script?foo=1&bar=2>).
0
+
0
+
0
+[1]: http://example.com/?foo=1&bar=2
0
+[2]: http://att.com/ "AT&T"
0
\ No newline at end of file
...
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
0
@@ -0,0 +1,18 @@
0
+<p>Link: <a href="http://example.com/">http://example.com/</a>.</p>
0
+
0
+<p>With an ampersand: <a href="http://example.com/?foo=1&amp;bar=2">http://example.com/?foo=1&amp;bar=2</a></p>
0
+
0
+<ul>
0
+<li>In a list?</li>
0
+<li><a href="http://example.com/">http://example.com/</a></li>
0
+<li>It should.</li>
0
+</ul>
0
+
0
+<blockquote>
0
+ <p>Blockquoted: <a href="http://example.com/">http://example.com/</a></p>
0
+</blockquote>
0
+
0
+<p>Auto-links should not occur here: <code>&lt;http://example.com/&gt;</code></p>
0
+
0
+<pre><code>or here: &lt;http://example.com/&gt;
0
+</code></pre>
...
 
 
 
 
 
 
 
 
 
 
 
 
 
0
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
0
@@ -0,0 +1,13 @@
0
+Link: <http://example.com/>.
0
+
0
+With an ampersand: <http://example.com/?foo=1&bar=2>
0
+
0
+* In a list?
0
+* <http://example.com/>
0
+* It should.
0
+
0
+> Blockquoted: <http://example.com/>
0
+
0
+Auto-links should not occur here: `<http://example.com/>`
0
+
0
+ or here: <http://example.com/>
0
\ No newline at end of file
...
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
0
@@ -0,0 +1,118 @@
0
+<p>These should all get escaped:</p>
0
+
0
+<p>Backslash: \</p>
0
+
0
+<p>Backtick: `</p>
0
+
0
+<p>Asterisk: *</p>
0
+
0
+<p>Underscore: _</p>
0
+
0
+<p>Left brace: {</p>
0
+
0
+<p>Right brace: }</p>
0
+
0
+<p>Left bracket: [</p>
0
+
0
+<p>Right bracket: ]</p>
0
+
0
+<p>Left paren: (</p>
0
+
0
+<p>Right paren: )</p>
0
+
0
+<p>Greater-than: ></p>
0
+
0
+<p>Hash: #</p>
0
+
0
+<p>Period: .</p>
0
+
0
+<p>Bang: !</p>
0
+
0
+<p>Plus: +</p>
0
+
0
+<p>Minus: -</p>
0
+
0
+<p>These should not, because they occur within a code block:</p>
0
+
0
+<pre><code>Backslash: \\
0
+
0
+Backtick: \`
0
+
0
+Asterisk: \*
0
+
0
+Underscore: \_
0
+
0
+Left brace: \{
0
+
0
+Right brace: \}
0
+
0
+Left bracket: \[
0
+
0
+Right bracket: \]
0
+
0
+Left paren: \(
0
+
0
+Right paren: \)
0
+
0
+Greater-than: \&gt;
0
+
0
+Hash: \#
0
+
0
+Period: \.
0
+
0
+Bang: \!
0
+
0
+Plus: \+
0
+
0
+Minus: \-
0
+</code></pre>
0
+
0
+<p>Nor should these, which occur in code spans:</p>
0
+
0
+<p>Backslash: <code>\\</code></p>
0
+
0
+<p>Backtick: <code>\`</code></p>
0
+
0
+<p>Asterisk: <code>\*</code></p>
0
+
0
+<p>Underscore: <code>\_</code></p>
0
+
0
+<p>Left brace: <code>\{</code></p>
0
+
0
+<p>Right brace: <code>\}</code></p>
0
+
0
+<p>Left bracket: <code>\[</code></p>
0
+
0
+<p>Right bracket: <code>\]</code></p>
0
+
0
+<p>Left paren: <code>\(</code></p>
0
+
0
+<p>Right paren: <code>\)</code></p>
0
+
0
+<p>Greater-than: <code>\&gt;</code></p>
0
+
0
+<p>Hash: <code>\#</code></p>
0
+
0
+<p>Period: <code>\.</code></p>
0
+
0
+<p>Bang: <code>\!</code></p>
0
+
0
+<p>Plus: <code>\+</code></p>
0
+
0
+<p>Minus: <code>\-</code></p>
0
+
0
+
0
+<p>These should get escaped, even though they're matching pairs for
0
+other Markdown constructs:</p>
0
+
0
+<p>*asterisks*</p>
0
+
0
+<p>_underscores_</p>
0
+
0
+<p>`backticks`</p>
0
+
0
+<p>This is a code span with a literal backslash-backtick sequence: <code>\`</code></p>
0
+
0
+<p>This is a tag with unescaped backticks <span attr='`ticks`'>bar</span>.</p>
0
+
0
+<p>This is a tag with backslashes <span attr='\\backslashes\\'>bar</span>.</p>
...
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
0
@@ -0,0 +1,120 @@
0
+These should all get escaped:
0
+
0
+Backslash: \\
0
+
0
+Backtick: \`
0
+
0
+Asterisk: \*
0
+
0
+Underscore: \_
0
+
0
+Left brace: \{
0
+
0
+Right brace: \}
0
+
0
+Left bracket: \[
0
+
0
+Right bracket: \]
0
+
0
+Left paren: \(
0
+
0
+Right paren: \)
0
+
0
+Greater-than: \>
0
+
0
+Hash: \#
0
+
0
+Period: \.
0
+
0
+Bang: \!
0
+
0
+Plus: \+
0
+
0
+Minus: \-
0
+
0
+
0
+
0
+These should not, because they occur within a code block:
0
+
0
+ Backslash: \\
0
+
0
+ Backtick: \`
0
+
0
+ Asterisk: \*
0
+
0
+ Underscore: \_
0
+
0
+ Left brace: \{
0
+
0
+ Right brace: \}
0
+
0
+ Left bracket: \[
0
+
0
+ Right bracket: \]
0
+
0
+ Left paren: \(
0
+
0
+ Right paren: \)
0
+
0
+ Greater-than: \>
0
+
0
+ Hash: \#
0
+
0
+ Period: \.
0
+
0
+ Bang: \!
0
+
0
+ Plus: \+
0
+
0
+ Minus: \-
0
+
0
+
0
+Nor should these, which occur in code spans:
0
+
0
+Backslash: `\\`
0
+
0
+Backtick: `` \` ``
0
+
0
+Asterisk: `\*`
0
+
0
+Underscore: `\_`
0
+
0
+Left brace: `\{`
0
+
0
+Right brace: `\}`
0
+
0
+Left bracket: `\[`
0
+
0
+Right bracket: `\]`
0
+
0
+Left paren: `\(`
0
+
0
+Right paren: `\)`
0
+
0
+Greater-than: `\>`
0
+
0
+Hash: `\#`
0
+
0
+Period: `\.`
0
+
0
+Bang: `\!`
0
+
0
+Plus: `\+`
0
+
0
+Minus: `\-`
0
+
0
+
0
+These should get escaped, even though they're matching pairs for
0
+other Markdown constructs:
0
+
0
+\*asterisks\*
0
+
0
+\_underscores\_
0
+
0
+\`backticks\`
0
+
0
+This is a code span with a literal backslash-backtick sequence: `` \` ``
0
+
0
+This is a tag with unescaped backticks <span attr='`ticks`'>bar</span>.
0
+
0
+This is a tag with backslashes <span attr='\\backslashes\\'>bar</span>.
...
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
0
@@ -0,0 +1,15 @@
0
+<blockquote>
0
+ <p>Example:</p>
0
+
0
+<pre><code>sub status {
0
+ print "working";
0
+}
0
+</code></pre>
0
+
0
+ <p>Or:</p>
0
+
0
+<pre><code>sub status {
0
+ return "working";
0
+}
0
+</code></pre>
0
+</blockquote>
...
 
 
 
 
 
 
 
 
 
 
 
...
1
2
3
4
5
6
7
8
9
10
11
0
@@ -0,0 +1,11 @@
0
+> Example:
0
+>
0
+> sub status {
0
+> print "working";
0
+> }
0
+>
0
+> Or:
0
+>
0
+> sub status {
0
+> return "working";
0
+> }
...
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
0
@@ -0,0 +1,18 @@
0
+<pre><code>code block on the first line
0
+</code></pre>
0
+
0
+<p>Regular text.</p>
0
+
0
+<pre><code>code block indented by spaces
0
+</code></pre>
0
+
0
+<p>Regular text.</p>
0
+
0
+<pre><code>the lines in this block
0
+all contain trailing spaces
0
+</code></pre>
0
+
0
+<p>Regular Text.</p>
0
+
0
+<pre><code>code block on the last line
0
+</code></pre>
...
 
 
 
 
 
 
 
 
 
 
 
 
 
 
0
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
0
@@ -0,0 +1,14 @@
0
+ code block on the first line
0
+
0
+Regular text.
0
+
0
+ code block indented by spaces
0
+
0
+Regular text.
0
+
0
+ the lines in this block
0
+ all contain trailing spaces
0
+
0
+Regular Text.
0
+
0
+ code block on the last line
0
\ No newline at end of file