diff options
| author | beatrice <beatrice@dangofactory.net> | 2026-11-22 20:01:35 +0900 |
|---|---|---|
| committer | beatrice <beatrice@dangofactory.net> | 2026-11-22 20:01:35 +0900 |
| commit | 6e93939f2b885f1f53836fa3e19b398a5ebbdf40 (patch) | |
| tree | 5fde91edefd5452acabd3e09426a5a47f232a64c /t | |
| download | Text-Markdown-master.tar.gz Text-Markdown-master.zip | |
Import Text-Markdown-1.000031.tar.gzHEADlocal/Text-Markdownmaster
Diffstat (limited to 't')
378 files changed, 9196 insertions, 0 deletions
diff --git a/t/02pod.t b/t/02pod.t new file mode 100644 index 0000000..251640d --- /dev/null +++ b/t/02pod.t @@ -0,0 +1,9 @@ +use strict; +use warnings; +use Test::More; + +eval "use Test::Pod 1.14"; +plan skip_all => 'Test::Pod 1.14 required' if $@; +plan skip_all => 'set TEST_POD to enable this test' unless $ENV{TEST_POD}; + +all_pod_files_ok(); diff --git a/t/03podcoverage.t b/t/03podcoverage.t new file mode 100644 index 0000000..ae59d4c --- /dev/null +++ b/t/03podcoverage.t @@ -0,0 +1,9 @@ +use strict; +use warnings; +use Test::More; + +eval "use Test::Pod::Coverage 1.04"; +plan skip_all => 'Test::Pod::Coverage 1.04 required' if $@; +plan skip_all => 'set TEST_POD to enable this test' unless $ENV{TEST_POD}; + +all_pod_coverage_ok(); diff --git a/t/04ensure_1_newline_before_EOF.t b/t/04ensure_1_newline_before_EOF.t new file mode 100644 index 0000000..fd58837 --- /dev/null +++ b/t/04ensure_1_newline_before_EOF.t @@ -0,0 +1,17 @@ +use strict; +use warnings; +use Test::More tests => 3; +use Test::Differences; + +use FindBin '$Bin'; +use lib "$Bin/../lib"; + +use_ok 'Text::Markdown'; +my $m = Text::Markdown->new(); +my ($out, $expected); + +$out = $m->markdown("foo\n\n\n"); +eq_or_diff($out, "<p>foo</p>\n", "collapse multiple newlines at EOF into one"); + +$out = $m->markdown("foo"); +eq_or_diff($out, "<p>foo</p>\n", "ensure newline before EOF"); diff --git a/t/05markdown_in_divs.t b/t/05markdown_in_divs.t new file mode 100644 index 0000000..a19f771 --- /dev/null +++ b/t/05markdown_in_divs.t @@ -0,0 +1,411 @@ +use strict; +use warnings; +use Test::More tests => 21; +use Test::Differences; +use FindBin '$Bin'; +use lib "$Bin/../lib"; + +use_ok 'Text::Markdown'; + +my $m = Text::Markdown->new(); +my ($html, $test); + +#------------------------------------------------------------------------------- +$test = "sanity check: markown in block elements doesn't get interpreted"; +$html = $m->markdown(<<"EOF"); +<h2> +Literal *asterisks* +and _underscores_ +</h2> +EOF +eq_or_diff $html, <<'EOF', $test; +<h2> +Literal *asterisks* +and _underscores_ +</h2> +EOF + + +#------------------------------------------------------------------------------- +$test = 'markdown on in div - generate <p> tags'; +$html = $m->markdown(<<"EOF"); +some text here + +<div markdown="1"> +Interpreted *asterisks* +and _underscores_ +</div> +EOF +eq_or_diff $html, <<'EOF', $test; +<p>some text here</p> + +<div> +<p>Interpreted <em>asterisks</em> +and <em>underscores</em></p> +</div> +EOF + + +#------------------------------------------------------------------------------- +$test = 'markdown on in h2 - no <p> tags in h2'; +$html = $m->markdown(<<"EOF"); +some text here + +<h2 markdown="on"> +Interpreted *asterisks* +and _underscores_ +</h2> +EOF +eq_or_diff $html, <<'EOF', $test; +<p>some text here</p> + +<h2> +Interpreted <em>asterisks</em> +and <em>underscores</em> +</h2> +EOF + + +#------------------------------------------------------------------------------- +# "block-level HTML elements — e.g. <div>, <table>, <pre>, <p>, etc. — must be separated +# from surrounding content by blank lines, and the start and end tags of the block +# should not be indented with tabs or spaces." -- http://daringfireball.net/projects/markdown/syntax#html +$test = 'some characters before an <h2> make the h2 an ignored element'; +$html = $m->markdown(<<"EOF"); +stuff<h2> +Interpreted *asterisks* and _underscores_ +because HTML block elements must be separated from surrounding content by blank lines +</h2> +EOF +eq_or_diff $html, <<'EOF', $test; +<p>stuff<h2> +Interpreted <em>asterisks</em> and <em>underscores</em> +because HTML block elements must be separated from surrounding content by blank lines +</h2></p> +EOF + + +#------------------------------------------------------------------------------- +$test = "adding markdown='on' if there were some characters before the h2, doesn't change anything. markdown='on' won't be removed."; +$html = $m->markdown(<<"EOF"); +stuff<h2 markdown="on"> +Interpreted *asterisks* and _underscores_, and markdown="on" left alone +because this wasn't a block HTML element in the first place +</h2> +EOF +eq_or_diff $html, <<'EOF', $test; +<p>stuff<h2 markdown="on"> +Interpreted <em>asterisks</em> and <em>underscores</em>, and markdown="on" left alone +because this wasn't a block HTML element in the first place +</h2></p> +EOF + + +#------------------------------------------------------------------------------- +$test = '<hr> in span-level HTML'; +$html = $m->markdown(<<"EOF"); +<span style="color: red"> +Interpreted *asterisks*. +<hr> +Interpreted _underscores_. +</span> +EOF +eq_or_diff $html, <<'EOF', $test; +<p><span style="color: red"> +Interpreted <em>asterisks</em>. +<hr> +Interpreted <em>underscores</em>. +</span></p> +EOF + + +#------------------------------------------------------------------------------- +$test = '<hr> in block-level HTML with markdown="on"'; +$html = $m->markdown(<<"EOF"); +<div markdown="on"> +Interpreted *asterisks*. +<hr> +Interpreted _underscores_. +</div> +EOF +eq_or_diff $html, <<'EOF', $test; +<div> +<p>Interpreted <em>asterisks</em>. +<hr> +Interpreted <em>underscores</em>.</p> +</div> +EOF + + +#------------------------------------------------------------------------------- +$test = "don't mess with the markdown attribute if part of code span or block"; +$html = $m->markdown(<<"EOF"); +A `<div markdown="1">` will interpret Markdown, unless in a code block. + + <div markdown="1"> + The *above* is a '<div>' tag + in a code block</div> +EOF +eq_or_diff $html, <<'EOF', $test; +<p>A <code><div markdown="1"></code> will interpret Markdown, unless in a code block.</p> + +<pre><code><div markdown="1"> +The *above* is a '<div>' tag +in a code block</div> +</code></pre> +EOF + + +#------------------------------------------------------------------------------- +$test = "leave [div] alone, it's not <div>"; +$html = $m->markdown(<<"EOF"); +[div markdown="1"] +The above is NOT a <div>! +</div> +EOF +eq_or_diff $html, <<'EOF', $test; +<p>[div markdown="1"] +The above is NOT a <div>! +</div></p> +EOF + + +#------------------------------------------------------------------------------- +$test = "leave !div! alone, it's not <div>, and it's in code too"; +$html = $m->markdown(<<"EOF"); + !div markdown="1"! + The above is NOT a <div>! + </div> +EOF +eq_or_diff $html, <<'EOF', $test; +<pre><code>!div markdown="1"! +The above is NOT a <div>! +</div> +</code></pre> +EOF + + +#------------------------------------------------------------------------------- +$test = 'start interpreting Markdown without blank line sandwiching'; +$html = $m->markdown(<<"EOF"); +*outside of the div* +<div markdown="1"> +*start interpreting Markdown without blank line sandwiching* +</div> +EOF +eq_or_diff $html, <<'EOF', $test; +<p><em>outside of the div</em></p> + +<div> +<p><em>start interpreting Markdown without blank line sandwiching</em></p> +</div> +EOF + + +#------------------------------------------------------------------------------- +$test = '<div markdown="1"> with inner list'; +$html = $m->markdown(<<"EOF"); +<div markdown="1"> + +1. this +2. is a list + +</div> +EOF + +eq_or_diff $html, <<'EOF', $test; +<div> +<ol> +<li>this</li> +<li>is a list</li> +</ol> +</div> +EOF + + +#------------------------------------------------------------------------------- +$test = '<div markdown="1"> with inner code block'; +$html = $m->markdown(<<"EOF"); +<div markdown="1"> + + code line 1 + code line 2 + +</div> +EOF + +eq_or_diff $html, <<'EOF', $test; +<div> +<pre><code>code line 1 +code line 2 +</code></pre> +</div> +EOF + + +#------------------------------------------------------------------------------- +$test = '<div markdown="1"> with inner blockquote'; +$html = $m->markdown(<<"EOF"); +<div markdown="1"> +> Thus spoke Lincoln +</div> +EOF + +eq_or_diff $html, <<'EOF', $test; +<div> +<blockquote> + <p>Thus spoke Lincoln</p> +</blockquote> +</div> +EOF + + +#------------------------------------------------------------------------------- +$test = '<div markdown="1"> with inner block HTML'; +$html = $m->markdown(<<"EOF"); +<div markdown="1"> +*interpreted* + +<div><script>var i = _count_ ;</script></div> +</div> +EOF + +eq_or_diff $html, <<'EOF', $test; +<div> +<p><em>interpreted</em></p> + +<div><script>var i = _count_ ;</script></div> +</div> +EOF + + +#------------------------------------------------------------------------------- +$test = '<div markdown="1"> with inner <div>, which ends with exactly one line'; +$html = $m->markdown(<<"EOF"); +<div markdown="1"> +<div><script>var i = _count_ ;</script></div> + + +</div> +EOF + +eq_or_diff $html, <<'EOF', $test; +<div> +<div><script>var i = _count_ ;</script></div> +</div> +EOF + + +#------------------------------------------------------------------------------- +$test = '<div markdown="1"> comprehensive'; +$html = $m->markdown(<<"EOF"); +*marked down text* + +<div markdown="1"> + +* this +* is a list + +</div> + +<div markdown="0"> +*no markdown interpretation here* +</div> + +<div> +*no markdown interpretation here* +</div> + +<div markdown="1" class="navbar"> +1. Home +2. About +</div> + +<div markdown="0" clas="web_counter"> +*no markdown interpretation here* +</div> +EOF + +eq_or_diff $html, <<'EOF', $test; +<p><em>marked down text</em></p> + +<div> +<ul> +<li>this</li> +<li>is a list</li> +</ul> +</div> + +<div> +*no markdown interpretation here* +</div> + +<div> +*no markdown interpretation here* +</div> + +<div class="navbar"> +<ol> +<li>Home</li> +<li>About</li> +</ol> +</div> + +<div clas="web_counter"> +*no markdown interpretation here* +</div> +EOF + + +#------------------------------------------------------------------------------- +$test = '<div markdown="1"> with multiple lines of attributes'; +$html = $m->markdown(<<"EOF"); +<div markdown="1" + class="navbar" +> +*multiple lines of attributes* +</div> +EOF +eq_or_diff $html, <<'EOF', $test; +<div + class="navbar" +> +<p><em>multiple lines of attributes</em></p> +</div> +EOF + + +#------------------------------------------------------------------------------- +$test = '<div \n\n...\n markdown="1"> - can put the markdown="1" attribute anywhere'; +$html = $m->markdown(<<"EOF"); +<div class="navbar" + markdown="1" +> +*multiple lines of attributes* +</div> +EOF +eq_or_diff $html, <<'EOF', $test; +<div class="navbar" +> +<p><em>multiple lines of attributes</em></p> +</div> +EOF + + +#------------------------------------------------------------------------------- +$test = "sanity check: just code"; +$html = $m->markdown(<<"EOF"); +Below is code + + code + +Above was code +EOF +eq_or_diff $html, <<'EOF', $test; +<p>Below is code</p> + +<pre><code>code +</code></pre> + +<p>Above was code</p> +EOF diff --git a/t/19exporter-markdown.t b/t/19exporter-markdown.t new file mode 100644 index 0000000..04c06ba --- /dev/null +++ b/t/19exporter-markdown.t @@ -0,0 +1,45 @@ +use strict; +use warnings; +use Test::More tests => 7; +use Test::Exception; + +use_ok( 'Text::Markdown', 'markdown' ); + +my $instr = q{A trivial block of text}; +my $outstr = q{<p>A trivial block of text</p>}; + +lives_ok { + $outstr = markdown($instr); +} 'Functional markdown works without an exception'; + +chomp($outstr); + +is( + $outstr => '<p>' . $instr . '</p>', + 'exported markdown function works' +); + +# Test that we *force* multimarkdown features to be off +$instr = q{# Heading 1}; +my $expstr = qq{<h1>Heading 1</h1>\n}; + +lives_ok { + $outstr = markdown($instr, { heading_ids => 1}); +} 'Functional markdown works without an exception, with options'; + +is( + $outstr => $expstr, + 'exported markdown function overrides passed options' +); + +{ + local $TODO = 'Broken here'; + $outstr = ''; + lives_ok { + $outstr = Text::Markdown->markdown($instr); + } 'Lives (class method)'; + + chomp($outstr); + + is($outstr, '<p>' . $instr . '</p>', 'Text::Markdown->markdown() works (as class method)'); +}; diff --git a/t/21fulldocs-text-markdown.t b/t/21fulldocs-text-markdown.t new file mode 100644 index 0000000..43c5630 --- /dev/null +++ b/t/21fulldocs-text-markdown.t @@ -0,0 +1,116 @@ +use strict; +use warnings; +use Test::More; +use FindBin qw($Bin); + +use List::MoreUtils qw(uniq); +use Encode; + +our $TIDY = 0; + +### Generate difftest subroutine, pretty prints diffs if you have Text::Diff, use uses +### Test::More::is otherwise. + +eval { + require Text::Diff; +}; +if (!$@) { + *difftest = sub { + my ($got, $expected, $testname) = @_; + $got .= "\n"; + $expected .= "\n"; + if ($got eq $expected) { + pass($testname); + return; + } + print "=" x 80 . "\nDIFFERENCES: + = processed version from .text, - = template from .html\n"; + print encode('utf8', Text::Diff::diff(\$expected => \$got, { STYLE => "Unified" }) . "\n"); + fail($testname); + }; +} +else { + warn("Install Text::Diff for more helpful failure messages! ($@)"); + *difftest = \&Test::More::is; +} + +sub tidy { + $TIDY = 1; + eval "use HTML::Tidy; "; + if ($@) { + plan skip_all => 'This test needs HTML::Tidy installed to pass correctly, skipping'; + exit; + } +} + +### Actual code for this test - unless(caller) stops it +### being run when this file is required by other tests + +unless (caller) { + my $docsdir = "$Bin/Text-Markdown.mdtest"; + my @files = get_files($docsdir); + + plan tests => scalar(@files) + 1; + + use_ok('Text::Markdown'); + + my $m = Text::Markdown->new(); + + run_tests($m, $docsdir, @files); +} + +sub get_files { + my ($docsdir) = @_; + my $DH; + opendir($DH, $docsdir) or die("Could not open $docsdir"); + my @files = uniq map { s/\.(xhtml|html|text)$// ? $_ : (); } readdir($DH); + closedir($DH); + return @files; +} + +sub slurp { + my ($filename) = @_; + open my $file, '<', $filename or die "Couldn't open $filename: $!"; + local $/ = undef; + return <$file>; +} + +sub run_tests { + my ($m, $docsdir, @files) = @_; + foreach my $test (@files) { + my ($input, $output); + eval { + if (-f "$docsdir/$test.html") { + $output = slurp("$docsdir/$test.html"); + } + else { + $output = slurp("$docsdir/$test.xhtml"); + } + $input = slurp("$docsdir/$test.text"); + }; + $input .= "\n\n"; + $output .= "\n\n"; + if ($@) { + fail("1 part of test file not found: $@"); + next; + } + $output =~ s/\s+\z//; # trim trailing whitespace + my $processed = $m->markdown($input); + $processed =~ s/\s+\z//; # trim trailing whitespace + + if ($TIDY) { + my $t = HTML::Tidy->new; + $output = $t->clean($output); + $processed = $t->clean($processed); + } + + # Un-comment for debugging if you have space diffs you can't see.. + $output =~ s/ / /g; + $output =~ s/\t/&tab;/g; + $processed =~ s/ / /g; + $processed =~ s/\t/&tab;/g; + + difftest($processed, $output, "Docs test: $test"); + } +} + +1; diff --git a/t/23fulldocs-markdown.t b/t/23fulldocs-markdown.t new file mode 100644 index 0000000..e9b8241 --- /dev/null +++ b/t/23fulldocs-markdown.t @@ -0,0 +1,18 @@ +use strict; +use warnings; +use Test::More; +use FindBin qw($Bin); + +require "$Bin/21fulldocs-text-markdown.t"; +tidy(); + +my $docsdir = "$Bin/Markdown-from-MDTest1.1.mdtest"; +my @files = get_files($docsdir); + +plan tests => scalar(@files) + 1; + +use_ok('Text::Markdown'); + +my $m = Text::Markdown->new(); + +run_tests($m, $docsdir, @files); diff --git a/t/25fulldocs-phpmarkdown.t b/t/25fulldocs-phpmarkdown.t new file mode 100644 index 0000000..d2c7c4d --- /dev/null +++ b/t/25fulldocs-phpmarkdown.t @@ -0,0 +1,22 @@ +use strict; +use warnings; +use Test::More; +use FindBin qw($Bin); + +require "$Bin/21fulldocs-text-markdown.t"; + +tidy(); + +my $docsdir = "$Bin/PHP_Markdown-from-MDTest1.1.mdtest"; +my @files = get_files($docsdir); + +plan tests => scalar(@files) + 1; + +use_ok('Text::Markdown'); + +my $m = Text::Markdown->new(); + +TODO: { + local $TODO = 'Have not fixed a load of the bugs PHP markdown has yet.'; + run_tests($m, $docsdir, @files); +}; diff --git a/t/31angleedgecase.t b/t/31angleedgecase.t new file mode 100644 index 0000000..1304221 --- /dev/null +++ b/t/31angleedgecase.t @@ -0,0 +1,18 @@ +use strict; +use warnings; +use Test::More tests => 2; + +# http://babelmark.bobtfish.net/?markdown=x%3Cmax(a%2Cb)%0D%0A&normalize=on + +use_ok('Text::Markdown'); + +my $m = Text::Markdown->new; + +my $in = q{x<max(a,b)}; +my $ex = q{<p>x<max(a,b)</p>}; + +{ + local $TODO = 'Known "bug" (the no < unless next to space thing was originally by design) - but I would like to +break the spec and fix this..'; + is ($m->markdown($in), $ex); +}; diff --git a/t/32tabwidth.t b/t/32tabwidth.t new file mode 100644 index 0000000..8b13a2b --- /dev/null +++ b/t/32tabwidth.t @@ -0,0 +1,37 @@ +use strict; +use warnings; +use Test::More tests => 4; + +use_ok( 'Text::Markdown' ); + +my $m = Text::Markdown->new( tab_width => 2 ); +my $instr = q{start + + <h1>HTML block</h1> + +end +}; + +my $expstr = q{<p>start</p> + +<pre><code><h1>HTML block</h1> +</code></pre> + +<p>end</p> +}; + +is($m->markdown($instr) => $expstr, 'Correct (constructor)'); +is(Text::Markdown->new->markdown($instr, { tab_width => 2}) => $expstr, 'Correct (markdown method option)'); + +my $txt = $m->markdown(<<'END_MARKDOWN'); +This is a para. + + This is code. + --- + This is code. + +This is a para. +END_MARKDOWN + +unlike($txt, qr{<hr}, "no HR elements when the hr is in a code block"); +
\ No newline at end of file diff --git a/t/33spaceinlinksandimages.t b/t/33spaceinlinksandimages.t new file mode 100644 index 0000000..3b447b8 --- /dev/null +++ b/t/33spaceinlinksandimages.t @@ -0,0 +1,15 @@ +use strict; +use warnings; +use Test::More tests => 2; + +use_ok('Text::Markdown'); + +{ + local $TODO = 'Proposed syntax extension (on list) to deal with spaces in URLs by quoting them'; + + my $instr = qq{\n}; + my $expstr = qq{<p><img src="pfad/und/eine%20lange/urlzu%20mbild.jpg" alt="alternativer text" title="testtitle" /></p>\n}; + + is(Text::Markdown::markdown($instr) => $expstr, 'as expected'); + +};
\ No newline at end of file diff --git a/t/34commandlinemarkdown.t b/t/34commandlinemarkdown.t new file mode 100644 index 0000000..92c0230 --- /dev/null +++ b/t/34commandlinemarkdown.t @@ -0,0 +1,16 @@ +use strict; +use warnings; +use FindBin qw($Bin); +use Test::More tests => 2; +use Test::Exception; + +my $filename = "$Bin/Markdown-from-MDTest1.1.mdtest/Markdown_Documentation_-_Syntax"; +unshift(@ARGV, "$filename.text"); +open my $file, '<', "$filename.xhtml" or die "Couldn't open $filename: $!"; +my $expected = do { local $/; <$file> }; + +lives_ok { + require "$Bin/../script/Markdown.pl"; +} 'require Markdown.pl works'; +my $out = main(); +is($out, $expected, 'Markdown.pl does the right thing with the syntax guide'); diff --git a/t/37anchormultilinebugs.t b/t/37anchormultilinebugs.t new file mode 100644 index 0000000..1a26bc7 --- /dev/null +++ b/t/37anchormultilinebugs.t @@ -0,0 +1,44 @@ +# http://bugs.debian.org/459885 +use strict; +use warnings; +use Test::More tests => 4; +# This is also tested in the Links Reference style test case. + + +use_ok('Text::Markdown'); + +my $m = Text::Markdown->new; + +my $in = q{[link +text] [link +id] + +[link id]: /someurl/ +}; +my $ex = q{<p><a href="/someurl/">link +text</a></p> +}; + +is($m->markdown($in), $ex, 'http://bugs.debian.org/459885 - Line breaks in reference link ids (single line breaks)'); + +$in = qq{Bla, bla, bla, bla, bla, bla, bla, bla, bla, bla bla. This is [my \nUniversity][]. + + [my university]: http://www.ua.es +}; +$ex = q{<p>Bla, bla, bla, bla, bla, bla, bla, bla, bla, bla bla. This is <a href="http://www.ua.es">my <br /> +University</a>.</p> +}; + +is($m->markdown($in), $ex, 'http://bugs.debian.org/459885 - Line breaks in reference link ids (multiple trailing spaces and line breaks)'); + +$in = qq{Bla, bla, bla, bla, bla, bla, bla, bla, bla, bla bla. This is [my \nUniversity]. + + [my university]: http://www.ua.es +}; +$ex = q{<p>Bla, bla, bla, bla, bla, bla, bla, bla, bla, bla bla. This is <a href="http://www.ua.es">my <br /> +University</a>.</p> +}; + +is($m->markdown($in), $ex, 'http://bugs.debian.org/459885 - Line breaks in shortcut reference link ids (multiple trailing spaces and line breaks)'); + + diff --git a/t/40trustliststart.t b/t/40trustliststart.t new file mode 100644 index 0000000..289e8d2 --- /dev/null +++ b/t/40trustliststart.t @@ -0,0 +1,33 @@ +use strict; +use warnings; +use Test::More tests => 2; + +use_ok( 'Text::Markdown' ); + +my $m = Text::Markdown->new(trust_list_start_value => 1); +my $html1 = $m->markdown(<<"EOF"); +1. this +2. is a list + +Paragraph. + +3. and we +4. pick up + +EOF + +my $want = <<'EOF'; +<ol start='1'> +<li>this</li> +<li>is a list</li> +</ol> + +<p>Paragraph.</p> + +<ol start='3'> +<li>and we</li> +<li>pick up</li> +</ol> +EOF + +is($html1, $want, "we can use numbering from start marker"); diff --git a/t/Markdown-from-MDTest1.1.mdtest/Amps_and_angle_encoding.text b/t/Markdown-from-MDTest1.1.mdtest/Amps_and_angle_encoding.text new file mode 100644 index 0000000..0e9527f --- /dev/null +++ b/t/Markdown-from-MDTest1.1.mdtest/Amps_and_angle_encoding.text @@ -0,0 +1,21 @@ +AT&T has an ampersand in their name. + +AT&T is another way to write it. + +This & that. + +4 < 5. + +6 > 5. + +Here's a [link] [1] with an ampersand in the URL. + +Here's a link with an amersand in the link text: [AT&T] [2]. + +Here's an inline [link](/script?foo=1&bar=2). + +Here's an inline [link](</script?foo=1&bar=2>). + + +[1]: http://example.com/?foo=1&bar=2 +[2]: http://att.com/ "AT&T"
\ No newline at end of file diff --git a/t/Markdown-from-MDTest1.1.mdtest/Amps_and_angle_encoding.xhtml b/t/Markdown-from-MDTest1.1.mdtest/Amps_and_angle_encoding.xhtml new file mode 100644 index 0000000..9606860 --- /dev/null +++ b/t/Markdown-from-MDTest1.1.mdtest/Amps_and_angle_encoding.xhtml @@ -0,0 +1,17 @@ +<p>AT&T has an ampersand in their name.</p> + +<p>AT&T is another way to write it.</p> + +<p>This & that.</p> + +<p>4 < 5.</p> + +<p>6 > 5.</p> + +<p>Here's a <a href="http://example.com/?foo=1&bar=2">link</a> with an ampersand in the URL.</p> + +<p>Here's a link with an amersand in the link text: <a href="http://att.com/" title="AT&T">AT&T</a>.</p> + +<p>Here's an inline <a href="/script?foo=1&bar=2">link</a>.</p> + +<p>Here's an inline <a href="/script?foo=1&bar=2">link</a>.</p> diff --git a/t/Markdown-from-MDTest1.1.mdtest/Auto_links.text b/t/Markdown-from-MDTest1.1.mdtest/Auto_links.text new file mode 100644 index 0000000..abbc488 --- /dev/null +++ b/t/Markdown-from-MDTest1.1.mdtest/Auto_links.text @@ -0,0 +1,13 @@ +Link: <http://example.com/>. + +With an ampersand: <http://example.com/?foo=1&bar=2> + +* In a list? +* <http://example.com/> +* It should. + +> Blockquoted: <http://example.com/> + +Auto-links should not occur here: `<http://example.com/>` + + or here: <http://example.com/>
\ No newline at end of file diff --git a/t/Markdown-from-MDTest1.1.mdtest/Auto_links.xhtml b/t/Markdown-from-MDTest1.1.mdtest/Auto_links.xhtml new file mode 100644 index 0000000..f8df985 --- /dev/null +++ b/t/Markdown-from-MDTest1.1.mdtest/Auto_links.xhtml @@ -0,0 +1,18 @@ +<p>Link: <a href="http://example.com/">http://example.com/</a>.</p> + +<p>With an ampersand: <a href="http://example.com/?foo=1&bar=2">http://example.com/?foo=1&bar=2</a></p> + +<ul> +<li>In a list?</li> +<li><a href="http://example.com/">http://example.com/</a></li> +<li>It should.</li> +</ul> + +<blockquote> + <p>Blockquoted: <a href="http://example.com/">http://example.com/</a></p> +</blockquote> + +<p>Auto-links should not occur here: <code><http://example.com/></code></p> + +<pre><code>or here: <http://example.com/> +</code></pre> diff --git a/t/Markdown-from-MDTest1.1.mdtest/Backslash_escapes.text b/t/Markdown-from-MDTest1.1.mdtest/Backslash_escapes.text new file mode 100644 index 0000000..5b014cb --- /dev/null +++ b/t/Markdown-from-MDTest1.1.mdtest/Backslash_escapes.text @@ -0,0 +1,120 @@ +These should all get escaped: + +Backslash: \\ + +Backtick: \` + +Asterisk: \* + +Underscore: \_ + +Left brace: \{ + +Right brace: \} + +Left bracket: \[ + +Right bracket: \] + +Left paren: \( + +Right paren: \) + +Greater-than: \> + +Hash: \# + +Period: \. + +Bang: \! + +Plus: \+ + +Minus: \- + + + +These should not, because they occur within a code block: + + Backslash: \\ + + Backtick: \` + + Asterisk: \* + + Underscore: \_ + + Left brace: \{ + + Right brace: \} + + Left bracket: \[ + + Right bracket: \] + + Left paren: \( + + Right paren: \) + + Greater-than: \> + + Hash: \# + + Period: \. + + Bang: \! + + Plus: \+ + + Minus: \- + + +Nor should these, which occur in code spans: + +Backslash: `\\` + +Backtick: `` \` `` + +Asterisk: `\*` + +Underscore: `\_` + +Left brace: `\{` + +Right brace: `\}` + +Left bracket: `\[` + +Right bracket: `\]` + +Left paren: `\(` + +Right paren: `\)` + +Greater-than: `\>` + +Hash: `\#` + +Period: `\.` + +Bang: `\!` + +Plus: `\+` + +Minus: `\-` + + +These should get escaped, even though they're matching pairs for +other Markdown constructs: + +\*asterisks\* + +\_underscores\_ + +\`backticks\` + +This is a code span with a literal backslash-backtick sequence: `` \` `` + +This is a tag with unescaped backticks <span attr='`ticks`'>bar</span>. + +This is a tag with backslashes <span attr='\\backslashes\\'>bar</span>. diff --git a/t/Markdown-from-MDTest1.1.mdtest/Backslash_escapes.xhtml b/t/Markdown-from-MDTest1.1.mdtest/Backslash_escapes.xhtml new file mode 100644 index 0000000..29870da --- /dev/null +++ b/t/Markdown-from-MDTest1.1.mdtest/Backslash_escapes.xhtml @@ -0,0 +1,118 @@ +<p>These should all get escaped:</p> + +<p>Backslash: \</p> + +<p>Backtick: `</p> + +<p>Asterisk: *</p> + +<p>Underscore: _</p> + +<p>Left brace: {</p> + +<p>Right brace: }</p> + +<p>Left bracket: [</p> + +<p>Right bracket: ]</p> + +<p>Left paren: (</p> + +<p>Right paren: )</p> + +<p>Greater-than: ></p> + +<p>Hash: #</p> + +<p>Period: .</p> + +<p>Bang: !</p> + +<p>Plus: +</p> + +<p>Minus: -</p> + +<p>These should not, because they occur within a code block:</p> + +<pre><code>Backslash: \\ + +Backtick: \` + +Asterisk: \* + +Underscore: \_ + +Left brace: \{ + +Right brace: \} + +Left bracket: \[ + +Right bracket: \] + +Left paren: \( + +Right paren: \) + +Greater-than: \> + +Hash: \# + +Period: \. + +Bang: \! + +Plus: \+ + +Minus: \- +</code></pre> + +<p>Nor should these, which occur in code spans:</p> + +<p>Backslash: <code>\\</code></p> + +<p>Backtick: <code>\`</code></p> + +<p>Asterisk: <code>\*</code></p> + +<p>Underscore: <code>\_</code></p> + +<p>Left brace: <code>\{</code></p> + +<p>Right brace: <code>\}</code></p> + +<p>Left bracket: <code>\[</code></p> + +<p>Right bracket: <code>\]</code></p> + +<p>Left paren: <code>\(</code></p> + +<p>Right paren: <code>\)</code></p> + +<p>Greater-than: <code>\></code></p> + +<p>Hash: <code>\#</code></p> + +<p>Period: <code>\.</code></p> + +<p>Bang: <code>\!</code></p> + +<p>Plus: <code>\+</code></p> + +<p>Minus: <code>\-</code></p> + + +<p>These should get escaped, even though they're matching pairs for +other Markdown constructs:</p> + +<p>*asterisks*</p> + +<p>_underscores_</p> + +<p>`backticks`</p> + +<p>This is a code span with a literal backslash-backtick sequence: <code>\`</code></p> + +<p>This is a tag with unescaped backticks <span attr='`ticks`'>bar</span>.</p> + +<p>This is a tag with backslashes <span attr='\\backslashes\\'>bar</span>.</p> diff --git a/t/Markdown-from-MDTest1.1.mdtest/Blockquotes_with_code_blocks.text b/t/Markdown-from-MDTest1.1.mdtest/Blockquotes_with_code_blocks.text new file mode 100644 index 0000000..c31d171 --- /dev/null +++ b/t/Markdown-from-MDTest1.1.mdtest/Blockquotes_with_code_blocks.text @@ -0,0 +1,11 @@ +> Example: +> +> sub status { +> print "working"; +> } +> +> Or: +> +> sub status { +> return "working"; +> } diff --git a/t/Markdown-from-MDTest1.1.mdtest/Blockquotes_with_code_blocks.xhtml b/t/Markdown-from-MDTest1.1.mdtest/Blockquotes_with_code_blocks.xhtml new file mode 100644 index 0000000..990202a --- /dev/null +++ b/t/Markdown-from-MDTest1.1.mdtest/Blockquotes_with_code_blocks.xhtml @@ -0,0 +1,15 @@ +<blockquote> + <p>Example:</p> + +<pre><code>sub status { + print "working"; +} +</code></pre> + + <p>Or:</p> + +<pre><code>sub status { + return "working"; +} +</code></pre> +</blockquote> diff --git a/t/Markdown-from-MDTest1.1.mdtest/Code_Blocks.text b/t/Markdown-from-MDTest1.1.mdtest/Code_Blocks.text new file mode 100644 index 0000000..b54b092 --- /dev/null +++ b/t/Markdown-from-MDTest1.1.mdtest/Code_Blocks.text @@ -0,0 +1,14 @@ + code block on the first line + +Regular text. + + code block indented by spaces + +Regular text. + + the lines in this block + all contain trailing spaces + +Regular Text. + + code block on the last line
\ No newline at end of file diff --git a/t/Markdown-from-MDTest1.1.mdtest/Code_Blocks.xhtml b/t/Markdown-from-MDTest1.1.mdtest/Code_Blocks.xhtml new file mode 100644 index 0000000..32703f5 --- /dev/null +++ b/t/Markdown-from-MDTest1.1.mdtest/Code_Blocks.xhtml @@ -0,0 +1,18 @@ +<pre><code>code block on the first line +</code></pre> + +<p>Regular text.</p> + +<pre><code>code block indented by spaces +</code></pre> + +<p>Regular text.</p> + +<pre><code>the lines in this block +all contain trailing spaces +</code></pre> + +<p>Regular Text.</p> + +<pre><code>code block on the last line +</code></pre> diff --git a/t/Markdown-from-MDTest1.1.mdtest/Code_Spans.text b/t/Markdown-from-MDTest1.1.mdtest/Code_Spans.text new file mode 100644 index 0000000..5c229c7 --- /dev/null +++ b/t/Markdown-from-MDTest1.1.mdtest/Code_Spans.text @@ -0,0 +1,5 @@ +`<test a="` content of attribute `">` + +Fix for backticks within HTML tag: <span attr='`ticks`'>like this</span> + +Here's how you put `` `backticks` `` in a code span.
\ No newline at end of file diff --git a/t/Markdown-from-MDTest1.1.mdtest/Code_Spans.xhtml b/t/Markdown-from-MDTest1.1.mdtest/Code_Spans.xhtml new file mode 100644 index 0000000..b057457 --- /dev/null +++ b/t/Markdown-from-MDTest1.1.mdtest/Code_Spans.xhtml @@ -0,0 +1,5 @@ +<p><code><test a="</code> content of attribute <code>"></code></p> + +<p>Fix for backticks within HTML tag: <span attr='`ticks`'>like this</span></p> + +<p>Here's how you put <code>`backticks`</code> in a code span.</p> diff --git a/t/Markdown-from-MDTest1.1.mdtest/Hard-wrapped_paragraphs_with_list-like_lines.text b/t/Markdown-from-MDTest1.1.mdtest/Hard-wrapped_paragraphs_with_list-like_lines.text new file mode 100644 index 0000000..f8a5b27 --- /dev/null +++ b/t/Markdown-from-MDTest1.1.mdtest/Hard-wrapped_paragraphs_with_list-like_lines.text @@ -0,0 +1,8 @@ +In Markdown 1.0.0 and earlier. Version +8. This line turns into a list item. +Because a hard-wrapped line in the +middle of a paragraph looked like a +list item. + +Here's one with a bullet. +* criminey. diff --git a/t/Markdown-from-MDTest1.1.mdtest/Hard-wrapped_paragraphs_with_list-like_lines.xhtml b/t/Markdown-from-MDTest1.1.mdtest/Hard-wrapped_paragraphs_with_list-like_lines.xhtml new file mode 100644 index 0000000..e21ac79 --- /dev/null +++ b/t/Markdown-from-MDTest1.1.mdtest/Hard-wrapped_paragraphs_with_list-like_lines.xhtml @@ -0,0 +1,8 @@ +<p>In Markdown 1.0.0 and earlier. Version +8. This line turns into a list item. +Because a hard-wrapped line in the +middle of a paragraph looked like a +list item.</p> + +<p>Here's one with a bullet. +* criminey.</p> diff --git a/t/Markdown-from-MDTest1.1.mdtest/Horizontal_rules.text b/t/Markdown-from-MDTest1.1.mdtest/Horizontal_rules.text new file mode 100644 index 0000000..1594bda --- /dev/null +++ b/t/Markdown-from-MDTest1.1.mdtest/Horizontal_rules.text @@ -0,0 +1,67 @@ +Dashes: + +--- + + --- + + --- + + --- + + --- + +- - - + + - - - + + - - - + + - - - + + - - - + + +Asterisks: + +*** + + *** + + *** + + *** + + *** + +* * * + + * * * + + * * * + + * * * + + * * * + + +Underscores: + +___ + + ___ + + ___ + + ___ + + ___ + +_ _ _ + + _ _ _ + + _ _ _ + + _ _ _ + + _ _ _ diff --git a/t/Markdown-from-MDTest1.1.mdtest/Horizontal_rules.xhtml b/t/Markdown-from-MDTest1.1.mdtest/Horizontal_rules.xhtml new file mode 100644 index 0000000..2dc2ab6 --- /dev/null +++ b/t/Markdown-from-MDTest1.1.mdtest/Horizontal_rules.xhtml @@ -0,0 +1,71 @@ +<p>Dashes:</p> + +<hr /> + +<hr /> + +<hr /> + +<hr /> + +<pre><code>--- +</code></pre> + +<hr /> + +<hr /> + +<hr /> + +<hr /> + +<pre><code>- - - +</code></pre> + +<p>Asterisks:</p> + +<hr /> + +<hr /> + +<hr /> + +<hr /> + +<pre><code>*** +</code></pre> + +<hr /> + +<hr /> + +<hr /> + +<hr /> + +<pre><code>* * * +</code></pre> + +<p>Underscores:</p> + +<hr /> + +<hr /> + +<hr /> + +<hr /> + +<pre><code>___ +</code></pre> + +<hr /> + +<hr /> + +<hr /> + +<hr /> + +<pre><code>_ _ _ +</code></pre> diff --git a/t/Markdown-from-MDTest1.1.mdtest/Images.text b/t/Markdown-from-MDTest1.1.mdtest/Images.text new file mode 100644 index 0000000..5707590 --- /dev/null +++ b/t/Markdown-from-MDTest1.1.mdtest/Images.text @@ -0,0 +1,26 @@ + + + + +Inline within a paragraph: [alt text](/url/). + + + + + + + +. + +![Empty]() + +.jpg) + + +![alt text][foo] + + [foo]: /url/ + +![alt text][bar] + + [bar]: /url/ "Title here"
\ No newline at end of file diff --git a/t/Markdown-from-MDTest1.1.mdtest/Images.xhtml b/t/Markdown-from-MDTest1.1.mdtest/Images.xhtml new file mode 100644 index 0000000..925bc14 --- /dev/null +++ b/t/Markdown-from-MDTest1.1.mdtest/Images.xhtml @@ -0,0 +1,21 @@ +<p><img src="/path/to/img.jpg" alt="Alt text" /></p> + +<p><img src="/path/to/img.jpg" alt="Alt text" title="Optional title" /></p> + +<p>Inline within a paragraph: <a href="/url/">alt text</a>.</p> + +<p><img src="/url/" alt="alt text" title="title preceded by two spaces" /></p> + +<p><img src="/url/" alt="alt text" title="title has spaces afterward" /></p> + +<p><img src="/url/" alt="alt text" /></p> + +<p><img src="/url/" alt="alt text" title="with a title" />.</p> + +<p><img src="" alt="Empty" /></p> + +<p><img src="http://example.com/(parens).jpg" alt="this is a stupid URL" /></p> + +<p><img src="/url/" alt="alt text" /></p> + +<p><img src="/url/" alt="alt text" title="Title here" /></p> diff --git a/t/Markdown-from-MDTest1.1.mdtest/Inline_HTML_(Advanced).text b/t/Markdown-from-MDTest1.1.mdtest/Inline_HTML_(Advanced).text new file mode 100644 index 0000000..3633f81 --- /dev/null +++ b/t/Markdown-from-MDTest1.1.mdtest/Inline_HTML_(Advanced).text @@ -0,0 +1,30 @@ +Simple block on one line: + +<div>foo</div> + +And nested without indentation: + +<div> +<div> +<div> +foo +</div> +<div style=">"/> +</div> +<div>bar</div> +</div> + +And with attributes: + +<div> + <div id="foo"> + </div> +</div> + +This was broken in 1.0.2b7: + +<div class="inlinepage"> +<div class="toggleableend"> +foo +</div> +</div> diff --git a/t/Markdown-from-MDTest1.1.mdtest/Inline_HTML_(Advanced).xhtml b/t/Markdown-from-MDTest1.1.mdtest/Inline_HTML_(Advanced).xhtml new file mode 100644 index 0000000..884f14c --- /dev/null +++ b/t/Markdown-from-MDTest1.1.mdtest/Inline_HTML_(Advanced).xhtml @@ -0,0 +1,30 @@ +<p>Simple block on one line:</p> + +<div>foo</div> + +<p>And nested without indentation:</p> + +<div> +<div> +<div> +foo +</div> +<div style=">"/> +</div> +<div>bar</div> +</div> + +<p>And with attributes:</p> + +<div> + <div id="foo"> + </div> +</div> + +<p>This was broken in 1.0.2b7:</p> + +<div class="inlinepage"> +<div class="toggleableend"> +foo +</div> +</div> diff --git a/t/Markdown-from-MDTest1.1.mdtest/Inline_HTML_(Simple).html b/t/Markdown-from-MDTest1.1.mdtest/Inline_HTML_(Simple).html new file mode 100644 index 0000000..6bf78f8 --- /dev/null +++ b/t/Markdown-from-MDTest1.1.mdtest/Inline_HTML_(Simple).html @@ -0,0 +1,72 @@ +<p>Here's a simple block:</p> + +<div> + foo +</div> + +<p>This should be a code block, though:</p> + +<pre><code><div> + foo +</div> +</code></pre> + +<p>As should this:</p> + +<pre><code><div>foo</div> +</code></pre> + +<p>Now, nested:</p> + +<div> + <div> + <div> + foo + </div> + </div> +</div> + +<p>This should just be an HTML comment:</p> + +<!-- Comment --> + +<p>Multiline:</p> + +<!-- +Blah +Blah +--> + +<p>Code block:</p> + +<pre><code><!-- Comment --> +</code></pre> + +<p>Just plain comment, with trailing spaces on the line:</p> + +<!-- foo --> + +<p>Code:</p> + +<pre><code><hr /> +</code></pre> + +<p>Hr's:</p> + +<hr> + +<hr/> + +<hr /> + +<hr> + +<hr/> + +<hr /> + +<hr class="foo" id="bar" /> + +<hr class="foo" id="bar"/> + +<hr class="foo" id="bar" > diff --git a/t/Markdown-from-MDTest1.1.mdtest/Inline_HTML_(Simple).text b/t/Markdown-from-MDTest1.1.mdtest/Inline_HTML_(Simple).text new file mode 100644 index 0000000..14aa2dc --- /dev/null +++ b/t/Markdown-from-MDTest1.1.mdtest/Inline_HTML_(Simple).text @@ -0,0 +1,69 @@ +Here's a simple block: + +<div> + foo +</div> + +This should be a code block, though: + + <div> + foo + </div> + +As should this: + + <div>foo</div> + +Now, nested: + +<div> + <div> + <div> + foo + </div> + </div> +</div> + +This should just be an HTML comment: + +<!-- Comment --> + +Multiline: + +<!-- +Blah +Blah +--> + +Code block: + + <!-- Comment --> + +Just plain comment, with trailing spaces on the line: + +<!-- foo --> + +Code: + + <hr /> + +Hr's: + +<hr> + +<hr/> + +<hr /> + +<hr> + +<hr/> + +<hr /> + +<hr class="foo" id="bar" /> + +<hr class="foo" id="bar"/> + +<hr class="foo" id="bar" > + diff --git a/t/Markdown-from-MDTest1.1.mdtest/Inline_HTML_comments.html b/t/Markdown-from-MDTest1.1.mdtest/Inline_HTML_comments.html new file mode 100644 index 0000000..3f167a1 --- /dev/null +++ b/t/Markdown-from-MDTest1.1.mdtest/Inline_HTML_comments.html @@ -0,0 +1,13 @@ +<p>Paragraph one.</p> + +<!-- This is a simple comment --> + +<!-- + This is another comment. +--> + +<p>Paragraph two.</p> + +<!-- one comment block -- -- with two comments --> + +<p>The end.</p> diff --git a/t/Markdown-from-MDTest1.1.mdtest/Inline_HTML_comments.text b/t/Markdown-from-MDTest1.1.mdtest/Inline_HTML_comments.text new file mode 100644 index 0000000..41d830d --- /dev/null +++ b/t/Markdown-from-MDTest1.1.mdtest/Inline_HTML_comments.text @@ -0,0 +1,13 @@ +Paragraph one. + +<!-- This is a simple comment --> + +<!-- + This is another comment. +--> + +Paragraph two. + +<!-- one comment block -- -- with two comments --> + +The end. diff --git a/t/Markdown-from-MDTest1.1.mdtest/Links_inline_style.text b/t/Markdown-from-MDTest1.1.mdtest/Links_inline_style.text new file mode 100644 index 0000000..aba9658 --- /dev/null +++ b/t/Markdown-from-MDTest1.1.mdtest/Links_inline_style.text @@ -0,0 +1,24 @@ +Just a [URL](/url/). + +[URL and title](/url/ "title"). + +[URL and title](/url/ "title preceded by two spaces"). + +[URL and title](/url/ "title preceded by a tab"). + +[URL and title](/url/ "title has spaces afterward" ). + +[URL wrapped in angle brackets](</url/>). + +[URL w/ angle brackets + title](</url/> "Here's the title"). + +[Empty](). + +[With parens in the URL](http://en.wikipedia.org/wiki/WIMP_(computing)) + +(With outer parens and [parens in url](/foo(bar))) + + +[With parens in the URL](/foo(bar) "and a title") + +(With outer parens and [parens in url](/foo(bar) "and a title")) diff --git a/t/Markdown-from-MDTest1.1.mdtest/Links_inline_style.xhtml b/t/Markdown-from-MDTest1.1.mdtest/Links_inline_style.xhtml new file mode 100644 index 0000000..9f351ef --- /dev/null +++ b/t/Markdown-from-MDTest1.1.mdtest/Links_inline_style.xhtml @@ -0,0 +1,23 @@ +<p>Just a <a href="/url/">URL</a>.</p> + +<p><a href="/url/" title="title">URL and title</a>.</p> + +<p><a href="/url/" title="title preceded by two spaces">URL and title</a>.</p> + +<p><a href="/url/" title="title preceded by a tab">URL and title</a>.</p> + +<p><a href="/url/" title="title has spaces afterward">URL and title</a>.</p> + +<p><a href="/url/">URL wrapped in angle brackets</a>.</p> + +<p><a href="/url/" title="Here's the title">URL w/ angle brackets + title</a>.</p> + +<p><a href="">Empty</a>.</p> + +<p><a href="http://en.wikipedia.org/wiki/WIMP_(computing)">With parens in the URL</a></p> + +<p>(With outer parens and <a href="/foo(bar)">parens in url</a>)</p> + +<p><a href="/foo(bar)" title="and a title">With parens in the URL</a></p> + +<p>(With outer parens and <a href="/foo(bar)" title="and a title">parens in url</a>)</p> diff --git a/t/Markdown-from-MDTest1.1.mdtest/Links_reference_style.text b/t/Markdown-from-MDTest1.1.mdtest/Links_reference_style.text new file mode 100644 index 0000000..341ec88 --- /dev/null +++ b/t/Markdown-from-MDTest1.1.mdtest/Links_reference_style.text @@ -0,0 +1,71 @@ +Foo [bar] [1]. + +Foo [bar][1]. + +Foo [bar] +[1]. + +[1]: /url/ "Title" + + +With [embedded [brackets]] [b]. + + +Indented [once][]. + +Indented [twice][]. + +Indented [thrice][]. + +Indented [four][] times. + + [once]: /url + + [twice]: /url + + [thrice]: /url + + [four]: /url + + +[b]: /url/ + +* * * + +[this] [this] should work + +So should [this][this]. + +And [this] []. + +And [this][]. + +And [this]. + +But not [that] []. + +Nor [that][]. + +Nor [that]. + +[Something in brackets like [this][] should work] + +[Same with [this].] + +In this case, [this](/somethingelse/) points to something else. + +Backslashing should suppress \[this] and [this\]. + +[this]: foo + + +* * * + +Here's one where the [link +breaks] across lines. + +Here's another where the [link +breaks] across lines, but with a line-ending space. + + +[link breaks]: /url/ diff --git a/t/Markdown-from-MDTest1.1.mdtest/Links_reference_style.xhtml b/t/Markdown-from-MDTest1.1.mdtest/Links_reference_style.xhtml new file mode 100644 index 0000000..8e70c32 --- /dev/null +++ b/t/Markdown-from-MDTest1.1.mdtest/Links_reference_style.xhtml @@ -0,0 +1,52 @@ +<p>Foo <a href="/url/" title="Title">bar</a>.</p> + +<p>Foo <a href="/url/" title="Title">bar</a>.</p> + +<p>Foo <a href="/url/" title="Title">bar</a>.</p> + +<p>With <a href="/url/">embedded [brackets]</a>.</p> + +<p>Indented <a href="/url">once</a>.</p> + +<p>Indented <a href="/url">twice</a>.</p> + +<p>Indented <a href="/url">thrice</a>.</p> + +<p>Indented [four][] times.</p> + +<pre><code>[four]: /url +</code></pre> + +<hr /> + +<p><a href="foo">this</a> should work</p> + +<p>So should <a href="foo">this</a>.</p> + +<p>And <a href="foo">this</a>.</p> + +<p>And <a href="foo">this</a>.</p> + +<p>And <a href="foo">this</a>.</p> + +<p>But not [that] [].</p> + +<p>Nor [that][].</p> + +<p>Nor [that].</p> + +<p>[Something in brackets like <a href="foo">this</a> should work]</p> + +<p>[Same with <a href="foo">this</a>.]</p> + +<p>In this case, <a href="/somethingelse/">this</a> points to something else.</p> + +<p>Backslashing should suppress [this] and [this].</p> + +<hr /> + +<p>Here's one where the <a href="/url/">link +breaks</a> across lines.</p> + +<p>Here's another where the <a href="/url/">link +breaks</a> across lines, but with a line-ending space.</p> diff --git a/t/Markdown-from-MDTest1.1.mdtest/Links_shortcut_references.text b/t/Markdown-from-MDTest1.1.mdtest/Links_shortcut_references.text new file mode 100644 index 0000000..8c44c98 --- /dev/null +++ b/t/Markdown-from-MDTest1.1.mdtest/Links_shortcut_references.text @@ -0,0 +1,20 @@ +This is the [simple case]. + +[simple case]: /simple + + + +This one has a [line +break]. + +This one has a [line +break] with a line-ending space. + +[line break]: /foo + + +[this] [that] and the [other] + +[this]: /this +[that]: /that +[other]: /other diff --git a/t/Markdown-from-MDTest1.1.mdtest/Links_shortcut_references.xhtml b/t/Markdown-from-MDTest1.1.mdtest/Links_shortcut_references.xhtml new file mode 100644 index 0000000..bf81e93 --- /dev/null +++ b/t/Markdown-from-MDTest1.1.mdtest/Links_shortcut_references.xhtml @@ -0,0 +1,9 @@ +<p>This is the <a href="/simple">simple case</a>.</p> + +<p>This one has a <a href="/foo">line +break</a>.</p> + +<p>This one has a <a href="/foo">line +break</a> with a line-ending space.</p> + +<p><a href="/that">this</a> and the <a href="/other">other</a></p> diff --git a/t/Markdown-from-MDTest1.1.mdtest/Literal_quotes_in_titles.text b/t/Markdown-from-MDTest1.1.mdtest/Literal_quotes_in_titles.text new file mode 100644 index 0000000..29d0e42 --- /dev/null +++ b/t/Markdown-from-MDTest1.1.mdtest/Literal_quotes_in_titles.text @@ -0,0 +1,7 @@ +Foo [bar][]. + +Foo [bar](/url/ "Title with "quotes" inside"). + + + [bar]: /url/ "Title with "quotes" inside" + diff --git a/t/Markdown-from-MDTest1.1.mdtest/Literal_quotes_in_titles.xhtml b/t/Markdown-from-MDTest1.1.mdtest/Literal_quotes_in_titles.xhtml new file mode 100644 index 0000000..611c1ac --- /dev/null +++ b/t/Markdown-from-MDTest1.1.mdtest/Literal_quotes_in_titles.xhtml @@ -0,0 +1,3 @@ +<p>Foo <a href="/url/" title="Title with "quotes" inside">bar</a>.</p> + +<p>Foo <a href="/url/" title="Title with "quotes" inside">bar</a>.</p> diff --git a/t/Markdown-from-MDTest1.1.mdtest/Markdown_Documentation_-_Basics.text b/t/Markdown-from-MDTest1.1.mdtest/Markdown_Documentation_-_Basics.text new file mode 100644 index 0000000..486055c --- /dev/null +++ b/t/Markdown-from-MDTest1.1.mdtest/Markdown_Documentation_-_Basics.text @@ -0,0 +1,306 @@ +Markdown: Basics +================ + +<ul id="ProjectSubmenu"> + <li><a href="/projects/markdown/" title="Markdown Project Page">Main</a></li> + <li><a class="selected" title="Markdown Basics">Basics</a></li> + <li><a href="/projects/markdown/syntax" title="Markdown Syntax Documentation">Syntax</a></li> + <li><a href="/projects/markdown/license" title="Pricing and License Information">License</a></li> + <li><a href="/projects/markdown/dingus" title="Online Markdown Web Form">Dingus</a></li> +</ul> + + +Getting the Gist of Markdown's Formatting Syntax +------------------------------------------------ + +This page offers a brief overview of what it's like to use Markdown. +The [syntax page] [s] provides complete, detailed documentation for +every feature, but Markdown should be very easy to pick up simply by +looking at a few examples of it in action. The examples on this page +are written in a before/after style, showing example syntax and the +HTML output produced by Markdown. + +It's also helpful to simply try Markdown out; the [Dingus] [d] is a +web application that allows you type your own Markdown-formatted text +and translate it to XHTML. + +**Note:** This document is itself written using Markdown; you +can [see the source for it by adding '.text' to the URL] [src]. + + [s]: /projects/markdown/syntax "Markdown Syntax" + [d]: /projects/markdown/dingus "Markdown Dingus" + [src]: /projects/markdown/basics.text + + +## Paragraphs, Headers, Blockquotes ## + +A paragraph is simply one or more consecutive lines of text, separated +by one or more blank lines. (A blank line is any line that looks like a +blank line -- a line containing nothing spaces or tabs is considered +blank.) Normal paragraphs should not be intended with spaces or tabs. + +Markdown offers two styles of headers: *Setext* and *atx*. +Setext-style headers for `<h1>` and `<h2>` are created by +"underlining" with equal signs (`=`) and hyphens (`-`), respectively. +To create an atx-style header, you put 1-6 hash marks (`#`) at the +beginning of the line -- the number of hashes equals the resulting +HTML header level. + +Blockquotes are indicated using email-style '`>`' angle brackets. + +Markdown: + + A First Level Header + ==================== + + A Second Level Header + --------------------- + + Now is the time for all good men to come to + the aid of their country. This is just a + regular paragraph. + + The quick brown fox jumped over the lazy + dog's back. + + ### Header 3 + + > This is a blockquote. + > + > This is the second paragraph in the blockquote. + > + > ## This is an H2 in a blockquote + + +Output: + + <h1>A First Level Header</h1> + + <h2>A Second Level Header</h2> + + <p>Now is the time for all good men to come to + the aid of their country. This is just a + regular paragraph.</p> + + <p>The quick brown fox jumped over the lazy + dog's back.</p> + + <h3>Header 3</h3> + + <blockquote> + <p>This is a blockquote.</p> + + <p>This is the second paragraph in the blockquote.</p> + + <h2>This is an H2 in a blockquote</h2> + </blockquote> + + + +### Phrase Emphasis ### + +Markdown uses asterisks and underscores to indicate spans of emphasis. + +Markdown: + + Some of these words *are emphasized*. + Some of these words _are emphasized also_. + + Use two asterisks for **strong emphasis**. + Or, if you prefer, __use two underscores instead__. + +Output: + + <p>Some of these words <em>are emphasized</em>. + Some of these words <em>are emphasized also</em>.</p> + + <p>Use two asterisks for <strong>strong emphasis</strong>. + Or, if you prefer, <strong>use two underscores instead</strong>.</p> + + + +## Lists ## + +Unordered (bulleted) lists use asterisks, pluses, and hyphens (`*`, +`+`, and `-`) as list markers. These three markers are +interchangable; this: + + * Candy. + * Gum. + * Booze. + +this: + + + Candy. + + Gum. + + Booze. + +and this: + + - Candy. + - Gum. + - Booze. + +all produce the same output: + + <ul> + <li>Candy.</li> + <li>Gum.</li> + <li>Booze.</li> + </ul> + +Ordered (numbered) lists use regular numbers, followed by periods, as +list markers: + + 1. Red + 2. Green + 3. Blue + +Output: + + <ol> + <li>Red</li> + <li>Green</li> + <li>Blue</li> + </ol> + +If you put blank lines between items, you'll get `<p>` tags for the +list item text. You can create multi-paragraph list items by indenting +the paragraphs by 4 spaces or 1 tab: + + * A list item. + + With multiple paragraphs. + + * Another item in the list. + +Output: + + <ul> + <li><p>A list item.</p> + <p>With multiple paragraphs.</p></li> + <li><p>Another item in the list.</p></li> + </ul> + + + +### Links ### + +Markdown supports two styles for creating links: *inline* and +*reference*. With both styles, you use square brackets to delimit the +text you want to turn into a link. + +Inline-style links use parentheses immediately after the link text. +For example: + + This is an [example link](http://example.com/). + +Output: + + <p>This is an <a href="http://example.com/"> + example link</a>.</p> + +Optionally, you may include a title attribute in the parentheses: + + This is an [example link](http://example.com/ "With a Title"). + +Output: + + <p>This is an <a href="http://example.com/" title="With a Title"> + example link</a>.</p> + +Reference-style links allow you to refer to your links by names, which +you define elsewhere in your document: + + I get 10 times more traffic from [Google][1] than from + [Yahoo][2] or [MSN][3]. + + [1]: http://google.com/ "Google" + [2]: http://search.yahoo.com/ "Yahoo Search" + [3]: http://search.msn.com/ "MSN Search" + +Output: + + <p>I get 10 times more traffic from <a href="http://google.com/" + title="Google">Google</a> than from <a href="http://search.yahoo.com/" + title="Yahoo Search">Yahoo</a> or <a href="http://search.msn.com/" + title="MSN Search">MSN</a>.</p> + +The title attribute is optional. Link names may contain letters, +numbers and spaces, but are *not* case sensitive: + + I start my morning with a cup of coffee and + [The New York Times][NY Times]. + + [ny times]: http://www.nytimes.com/ + +Output: + + <p>I start my morning with a cup of coffee and + <a href="http://www.nytimes.com/">The New York Times</a>.</p> + + +### Images ### + +Image syntax is very much like link syntax. + +Inline (titles are optional): + +  + +Reference-style: + + ![alt text][id] + + [id]: /path/to/img.jpg "Title" + +Both of the above examples produce the same output: + + <img src="/path/to/img.jpg" alt="alt text" title="Title" /> + + + +### Code ### + +In a regular paragraph, you can create code span by wrapping text in +backtick quotes. Any ampersands (`&`) and angle brackets (`<` or +`>`) will automatically be translated into HTML entities. This makes +it easy to use Markdown to write about HTML example code: + + I strongly recommend against using any `<blink>` tags. + + I wish SmartyPants used named entities like `—` + instead of decimal-encoded entites like `—`. + +Output: + + <p>I strongly recommend against using any + <code><blink></code> tags.</p> + + <p>I wish SmartyPants used named entities like + <code>&mdash;</code> instead of decimal-encoded + entites like <code>&#8212;</code>.</p> + + +To specify an entire block of pre-formatted code, indent every line of +the block by 4 spaces or 1 tab. Just like with code spans, `&`, `<`, +and `>` characters will be escaped automatically. + +Markdown: + + If you want your page to validate under XHTML 1.0 Strict, + you've got to put paragraph tags in your blockquotes: + + <blockquote> + <p>For example.</p> + </blockquote> + +Output: + + <p>If you want your page to validate under XHTML 1.0 Strict, + you've got to put paragraph tags in your blockquotes:</p> + + <pre><code><blockquote> + <p>For example.</p> + </blockquote> + </code></pre> diff --git a/t/Markdown-from-MDTest1.1.mdtest/Markdown_Documentation_-_Basics.xhtml b/t/Markdown-from-MDTest1.1.mdtest/Markdown_Documentation_-_Basics.xhtml new file mode 100644 index 0000000..d5bdbb2 --- /dev/null +++ b/t/Markdown-from-MDTest1.1.mdtest/Markdown_Documentation_-_Basics.xhtml @@ -0,0 +1,314 @@ +<h1>Markdown: Basics</h1> + +<ul id="ProjectSubmenu"> + <li><a href="/projects/markdown/" title="Markdown Project Page">Main</a></li> + <li><a class="selected" title="Markdown Basics">Basics</a></li> + <li><a href="/projects/markdown/syntax" title="Markdown Syntax Documentation">Syntax</a></li> + <li><a href="/projects/markdown/license" title="Pricing and License Information">License</a></li> + <li><a href="/projects/markdown/dingus" title="Online Markdown Web Form">Dingus</a></li> +</ul> + +<h2>Getting the Gist of Markdown's Formatting Syntax</h2> + +<p>This page offers a brief overview of what it's like to use Markdown. +The <a href="/projects/markdown/syntax" title="Markdown Syntax">syntax page</a> provides complete, detailed documentation for +every feature, but Markdown should be very easy to pick up simply by +looking at a few examples of it in action. The examples on this page +are written in a before/after style, showing example syntax and the +HTML output produced by Markdown.</p> + +<p>It's also helpful to simply try Markdown out; the <a href="/projects/markdown/dingus" title="Markdown Dingus">Dingus</a> is a +web application that allows you type your own Markdown-formatted text +and translate it to XHTML.</p> + +<p><strong>Note:</strong> This document is itself written using Markdown; you +can <a href="/projects/markdown/basics.text">see the source for it by adding '.text' to the URL</a>.</p> + +<h2>Paragraphs, Headers, Blockquotes</h2> + +<p>A paragraph is simply one or more consecutive lines of text, separated +by one or more blank lines. (A blank line is any line that looks like a +blank line -- a line containing nothing spaces or tabs is considered +blank.) Normal paragraphs should not be intended with spaces or tabs.</p> + +<p>Markdown offers two styles of headers: <em>Setext</em> and <em>atx</em>. +Setext-style headers for <code><h1></code> and <code><h2></code> are created by +"underlining" with equal signs (<code>=</code>) and hyphens (<code>-</code>), respectively. +To create an atx-style header, you put 1-6 hash marks (<code>#</code>) at the +beginning of the line -- the number of hashes equals the resulting +HTML header level.</p> + +<p>Blockquotes are indicated using email-style '<code>></code>' angle brackets.</p> + +<p>Markdown:</p> + +<pre><code>A First Level Header +==================== + +A Second Level Header +--------------------- + +Now is the time for all good men to come to +the aid of their country. This is just a +regular paragraph. + +The quick brown fox jumped over the lazy +dog's back. + +### Header 3 + +> This is a blockquote. +> +> This is the second paragraph in the blockquote. +> +> ## This is an H2 in a blockquote +</code></pre> + +<p>Output:</p> + +<pre><code><h1>A First Level Header</h1> + +<h2>A Second Level Header</h2> + +<p>Now is the time for all good men to come to +the aid of their country. This is just a +regular paragraph.</p> + +<p>The quick brown fox jumped over the lazy +dog's back.</p> + +<h3>Header 3</h3> + +<blockquote> + <p>This is a blockquote.</p> + + <p>This is the second paragraph in the blockquote.</p> + + <h2>This is an H2 in a blockquote</h2> +</blockquote> +</code></pre> + +<h3>Phrase Emphasis</h3> + +<p>Markdown uses asterisks and underscores to indicate spans of emphasis.</p> + +<p>Markdown:</p> + +<pre><code>Some of these words *are emphasized*. +Some of these words _are emphasized also_. + +Use two asterisks for **strong emphasis**. +Or, if you prefer, __use two underscores instead__. +</code></pre> + +<p>Output:</p> + +<pre><code><p>Some of these words <em>are emphasized</em>. +Some of these words <em>are emphasized also</em>.</p> + +<p>Use two asterisks for <strong>strong emphasis</strong>. +Or, if you prefer, <strong>use two underscores instead</strong>.</p> +</code></pre> + +<h2>Lists</h2> + +<p>Unordered (bulleted) lists use asterisks, pluses, and hyphens (<code>*</code>, +<code>+</code>, and <code>-</code>) as list markers. These three markers are +interchangable; this:</p> + +<pre><code>* Candy. +* Gum. +* Booze. +</code></pre> + +<p>this:</p> + +<pre><code>+ Candy. ++ Gum. ++ Booze. +</code></pre> + +<p>and this:</p> + +<pre><code>- Candy. +- Gum. +- Booze. +</code></pre> + +<p>all produce the same output:</p> + +<pre><code><ul> +<li>Candy.</li> +<li>Gum.</li> +<li>Booze.</li> +</ul> +</code></pre> + +<p>Ordered (numbered) lists use regular numbers, followed by periods, as +list markers:</p> + +<pre><code>1. Red +2. Green +3. Blue +</code></pre> + +<p>Output:</p> + +<pre><code><ol> +<li>Red</li> +<li>Green</li> +<li>Blue</li> +</ol> +</code></pre> + +<p>If you put blank lines between items, you'll get <code><p></code> tags for the +list item text. You can create multi-paragraph list items by indenting +the paragraphs by 4 spaces or 1 tab:</p> + +<pre><code>* A list item. + + With multiple paragraphs. + +* Another item in the list. +</code></pre> + +<p>Output:</p> + +<pre><code><ul> +<li><p>A list item.</p> +<p>With multiple paragraphs.</p></li> +<li><p>Another item in the list.</p></li> +</ul> +</code></pre> + +<h3>Links</h3> + +<p>Markdown supports two styles for creating links: <em>inline</em> and +<em>reference</em>. With both styles, you use square brackets to delimit the +text you want to turn into a link.</p> + +<p>Inline-style links use parentheses immediately after the link text. +For example:</p> + +<pre><code>This is an [example link](http://example.com/). +</code></pre> + +<p>Output:</p> + +<pre><code><p>This is an <a href="http://example.com/"> +example link</a>.</p> +</code></pre> + +<p>Optionally, you may include a title attribute in the parentheses:</p> + +<pre><code>This is an [example link](http://example.com/ "With a Title"). +</code></pre> + +<p>Output:</p> + +<pre><code><p>This is an <a href="http://example.com/" title="With a Title"> +example link</a>.</p> +</code></pre> + +<p>Reference-style links allow you to refer to your links by names, which +you define elsewhere in your document:</p> + +<pre><code>I get 10 times more traffic from [Google][1] than from +[Yahoo][2] or [MSN][3]. + +[1]: http://google.com/ "Google" +[2]: http://search.yahoo.com/ "Yahoo Search" +[3]: http://search.msn.com/ "MSN Search" +</code></pre> + +<p>Output:</p> + +<pre><code><p>I get 10 times more traffic from <a href="http://google.com/" +title="Google">Google</a> than from <a href="http://search.yahoo.com/" +title="Yahoo Search">Yahoo</a> or <a href="http://search.msn.com/" +title="MSN Search">MSN</a>.</p> +</code></pre> + +<p>The title attribute is optional. Link names may contain letters, +numbers and spaces, but are <em>not</em> case sensitive:</p> + +<pre><code>I start my morning with a cup of coffee and +[The New York Times][NY Times]. + +[ny times]: http://www.nytimes.com/ +</code></pre> + +<p>Output:</p> + +<pre><code><p>I start my morning with a cup of coffee and +<a href="http://www.nytimes.com/">The New York Times</a>.</p> +</code></pre> + +<h3>Images</h3> + +<p>Image syntax is very much like link syntax.</p> + +<p>Inline (titles are optional):</p> + +<pre><code> +</code></pre> + +<p>Reference-style:</p> + +<pre><code>![alt text][id] + +[id]: /path/to/img.jpg "Title" +</code></pre> + +<p>Both of the above examples produce the same output:</p> + +<pre><code><img src="/path/to/img.jpg" alt="alt text" title="Title" /> +</code></pre> + +<h3>Code</h3> + +<p>In a regular paragraph, you can create code span by wrapping text in +backtick quotes. Any ampersands (<code>&</code>) and angle brackets (<code><</code> or +<code>></code>) will automatically be translated into HTML entities. This makes +it easy to use Markdown to write about HTML example code:</p> + +<pre><code>I strongly recommend against using any `<blink>` tags. + +I wish SmartyPants used named entities like `&mdash;` +instead of decimal-encoded entites like `&#8212;`. +</code></pre> + +<p>Output:</p> + +<pre><code><p>I strongly recommend against using any +<code>&lt;blink&gt;</code> tags.</p> + +<p>I wish SmartyPants used named entities like +<code>&amp;mdash;</code> instead of decimal-encoded +entites like <code>&amp;#8212;</code>.</p> +</code></pre> + +<p>To specify an entire block of pre-formatted code, indent every line of +the block by 4 spaces or 1 tab. Just like with code spans, <code>&</code>, <code><</code>, +and <code>></code> characters will be escaped automatically.</p> + +<p>Markdown:</p> + +<pre><code>If you want your page to validate under XHTML 1.0 Strict, +you've got to put paragraph tags in your blockquotes: + + <blockquote> + <p>For example.</p> + </blockquote> +</code></pre> + +<p>Output:</p> + +<pre><code><p>If you want your page to validate under XHTML 1.0 Strict, +you've got to put paragraph tags in your blockquotes:</p> + +<pre><code>&lt;blockquote&gt; + &lt;p&gt;For example.&lt;/p&gt; +&lt;/blockquote&gt; +</code></pre> +</code></pre> diff --git a/t/Markdown-from-MDTest1.1.mdtest/Markdown_Documentation_-_Syntax.text b/t/Markdown-from-MDTest1.1.mdtest/Markdown_Documentation_-_Syntax.text new file mode 100644 index 0000000..57360a1 --- /dev/null +++ b/t/Markdown-from-MDTest1.1.mdtest/Markdown_Documentation_-_Syntax.text @@ -0,0 +1,888 @@ +Markdown: Syntax +================ + +<ul id="ProjectSubmenu"> + <li><a href="/projects/markdown/" title="Markdown Project Page">Main</a></li> + <li><a href="/projects/markdown/basics" title="Markdown Basics">Basics</a></li> + <li><a class="selected" title="Markdown Syntax Documentation">Syntax</a></li> + <li><a href="/projects/markdown/license" title="Pricing and License Information">License</a></li> + <li><a href="/projects/markdown/dingus" title="Online Markdown Web Form">Dingus</a></li> +</ul> + + +* [Overview](#overview) + * [Philosophy](#philosophy) + * [Inline HTML](#html) + * [Automatic Escaping for Special Characters](#autoescape) +* [Block Elements](#block) + * [Paragraphs and Line Breaks](#p) + * [Headers](#header) + * [Blockquotes](#blockquote) + * [Lists](#list) + * [Code Blocks](#precode) + * [Horizontal Rules](#hr) +* [Span Elements](#span) + * [Links](#link) + * [Emphasis](#em) + * [Code](#code) + * [Images](#img) +* [Miscellaneous](#misc) + * [Backslash Escapes](#backslash) + * [Automatic Links](#autolink) + + +**Note:** This document is itself written using Markdown; you +can [see the source for it by adding '.text' to the URL][src]. + + [src]: /projects/markdown/syntax.text + +* * * + +<h2 id="overview">Overview</h2> + +<h3 id="philosophy">Philosophy</h3> + +Markdown is intended to be as easy-to-read and easy-to-write as is feasible. + +Readability, however, is emphasized above all else. A Markdown-formatted +document should be publishable as-is, as plain text, without looking +like it's been marked up with tags or formatting instructions. While +Markdown's syntax has been influenced by several existing text-to-HTML +filters -- including [Setext] [1], [atx] [2], [Textile] [3], [reStructuredText] [4], +[Grutatext] [5], and [EtText] [6] -- the single biggest source of +inspiration for Markdown's syntax is the format of plain text email. + + [1]: http://docutils.sourceforge.net/mirror/setext.html + [2]: http://www.aaronsw.com/2002/atx/ + [3]: http://textism.com/tools/textile/ + [4]: http://docutils.sourceforge.net/rst.html + [5]: http://www.triptico.com/software/grutatxt.html + [6]: http://ettext.taint.org/doc/ + +To this end, Markdown's syntax is comprised entirely of punctuation +characters, which punctuation characters have been carefully chosen so +as to look like what they mean. E.g., asterisks around a word actually +look like \*emphasis\*. Markdown lists look like, well, lists. Even +blockquotes look like quoted passages of text, assuming you've ever +used email. + + + +<h3 id="html">Inline HTML</h3> + +Markdown's syntax is intended for one purpose: to be used as a +format for *writing* for the web. + +Markdown is not a replacement for HTML, or even close to it. Its +syntax is very small, corresponding only to a very small subset of +HTML tags. The idea is *not* to create a syntax that makes it easier +to insert HTML tags. In my opinion, HTML tags are already easy to +insert. The idea for Markdown is to make it easy to read, write, and +edit prose. HTML is a *publishing* format; Markdown is a *writing* +format. Thus, Markdown's formatting syntax only addresses issues that +can be conveyed in plain text. + +For any markup that is not covered by Markdown's syntax, you simply +use HTML itself. There's no need to preface it or delimit it to +indicate that you're switching from Markdown to HTML; you just use +the tags. + +The only restrictions are that block-level HTML elements -- e.g. `<div>`, +`<table>`, `<pre>`, `<p>`, etc. -- must be separated from surrounding +content by blank lines, and the start and end tags of the block should +not be indented with tabs or spaces. Markdown is smart enough not +to add extra (unwanted) `<p>` tags around HTML block-level tags. + +For example, to add an HTML table to a Markdown article: + + This is a regular paragraph. + + <table> + <tr> + <td>Foo</td> + </tr> + </table> + + This is another regular paragraph. + +Note that Markdown formatting syntax is not processed within block-level +HTML tags. E.g., you can't use Markdown-style `*emphasis*` inside an +HTML block. + +Span-level HTML tags -- e.g. `<span>`, `<cite>`, or `<del>` -- can be +used anywhere in a Markdown paragraph, list item, or header. If you +want, you can even use HTML tags instead of Markdown formatting; e.g. if +you'd prefer to use HTML `<a>` or `<img>` tags instead of Markdown's +link or image syntax, go right ahead. + +Unlike block-level HTML tags, Markdown syntax *is* processed within +span-level tags. + + +<h3 id="autoescape">Automatic Escaping for Special Characters</h3> + +In HTML, there are two characters that demand special treatment: `<` +and `&`. Left angle brackets are used to start tags; ampersands are +used to denote HTML entities. If you want to use them as literal +characters, you must escape them as entities, e.g. `<`, and +`&`. + +Ampersands in particular are bedeviling for web writers. If you want to +write about 'AT&T', you need to write '`AT&T`'. You even need to +escape ampersands within URLs. Thus, if you want to link to: + + http://images.google.com/images?num=30&q=larry+bird + +you need to encode the URL as: + + http://images.google.com/images?num=30&q=larry+bird + +in your anchor tag `href` attribute. Needless to say, this is easy to +forget, and is probably the single most common source of HTML validation +errors in otherwise well-marked-up web sites. + +Markdown allows you to use these characters naturally, taking care of +all the necessary escaping for you. If you use an ampersand as part of +an HTML entity, it remains unchanged; otherwise it will be translated +into `&`. + +So, if you want to include a copyright symbol in your article, you can write: + + © + +and Markdown will leave it alone. But if you write: + + AT&T + +Markdown will translate it to: + + AT&T + +Similarly, because Markdown supports [inline HTML](#html), if you use +angle brackets as delimiters for HTML tags, Markdown will treat them as +such. But if you write: + + 4 < 5 + +Markdown will translate it to: + + 4 < 5 + +However, inside Markdown code spans and blocks, angle brackets and +ampersands are *always* encoded automatically. This makes it easy to use +Markdown to write about HTML code. (As opposed to raw HTML, which is a +terrible format for writing about HTML syntax, because every single `<` +and `&` in your example code needs to be escaped.) + + +* * * + + +<h2 id="block">Block Elements</h2> + + +<h3 id="p">Paragraphs and Line Breaks</h3> + +A paragraph is simply one or more consecutive lines of text, separated +by one or more blank lines. (A blank line is any line that looks like a +blank line -- a line containing nothing but spaces or tabs is considered +blank.) Normal paragraphs should not be intended with spaces or tabs. + +The implication of the "one or more consecutive lines of text" rule is +that Markdown supports "hard-wrapped" text paragraphs. This differs +significantly from most other text-to-HTML formatters (including Movable +Type's "Convert Line Breaks" option) which translate every line break +character in a paragraph into a `<br />` tag. + +When you *do* want to insert a `<br />` break tag using Markdown, you +end a line with two or more spaces, then type return. + +Yes, this takes a tad more effort to create a `<br />`, but a simplistic +"every line break is a `<br />`" rule wouldn't work for Markdown. +Markdown's email-style [blockquoting][bq] and multi-paragraph [list items][l] +work best -- and look better -- when you format them with hard breaks. + + [bq]: #blockquote + [l]: #list + + + +<h3 id="header">Headers</h3> + +Markdown supports two styles of headers, [Setext] [1] and [atx] [2]. + +Setext-style headers are "underlined" using equal signs (for first-level +headers) and dashes (for second-level headers). For example: + + This is an H1 + ============= + + This is an H2 + ------------- + +Any number of underlining `=`'s or `-`'s will work. + +Atx-style headers use 1-6 hash characters at the start of the line, +corresponding to header levels 1-6. For example: + + # This is an H1 + + ## This is an H2 + + ###### This is an H6 + +Optionally, you may "close" atx-style headers. This is purely +cosmetic -- you can use this if you think it looks better. The +closing hashes don't even need to match the number of hashes +used to open the header. (The number of opening hashes +determines the header level.) : + + # This is an H1 # + + ## This is an H2 ## + + ### This is an H3 ###### + + +<h3 id="blockquote">Blockquotes</h3> + +Markdown uses email-style `>` characters for blockquoting. If you're +familiar with quoting passages of text in an email message, then you +know how to create a blockquote in Markdown. It looks best if you hard +wrap the text and put a `>` before every line: + + > This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet, + > consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus. + > Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus. + > + > Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse + > id sem consectetuer libero luctus adipiscing. + +Markdown allows you to be lazy and only put the `>` before the first +line of a hard-wrapped paragraph: + + > This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet, + consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus. + Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus. + + > Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse + id sem consectetuer libero luctus adipiscing. + +Blockquotes can be nested (i.e. a blockquote-in-a-blockquote) by +adding additional levels of `>`: + + > This is the first level of quoting. + > + > > This is nested blockquote. + > + > Back to the first level. + +Blockquotes can contain other Markdown elements, including headers, lists, +and code blocks: + + > ## This is a header. + > + > 1. This is the first list item. + > 2. This is the second list item. + > + > Here's some example code: + > + > return shell_exec("echo $input | $markdown_script"); + +Any decent text editor should make email-style quoting easy. For +example, with BBEdit, you can make a selection and choose Increase +Quote Level from the Text menu. + + +<h3 id="list">Lists</h3> + +Markdown supports ordered (numbered) and unordered (bulleted) lists. + +Unordered lists use asterisks, pluses, and hyphens -- interchangably +-- as list markers: + + * Red + * Green + * Blue + +is equivalent to: + + + Red + + Green + + Blue + +and: + + - Red + - Green + - Blue + +Ordered lists use numbers followed by periods: + + 1. Bird + 2. McHale + 3. Parish + +It's important to note that the actual numbers you use to mark the +list have no effect on the HTML output Markdown produces. The HTML +Markdown produces from the above list is: + + <ol> + <li>Bird</li> + <li>McHale</li> + <li>Parish</li> + </ol> + +If you instead wrote the list in Markdown like this: + + 1. Bird + 1. McHale + 1. Parish + +or even: + + 3. Bird + 1. McHale + 8. Parish + +you'd get the exact same HTML output. The point is, if you want to, +you can use ordinal numbers in your ordered Markdown lists, so that +the numbers in your source match the numbers in your published HTML. +But if you want to be lazy, you don't have to. + +If you do use lazy list numbering, however, you should still start the +list with the number 1. At some point in the future, Markdown may support +starting ordered lists at an arbitrary number. + +List markers typically start at the left margin, but may be indented by +up to three spaces. List markers must be followed by one or more spaces +or a tab. + +To make lists look nice, you can wrap items with hanging indents: + + * Lorem ipsum dolor sit amet, consectetuer adipiscing elit. + Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi, + viverra nec, fringilla in, laoreet vitae, risus. + * Donec sit amet nisl. Aliquam semper ipsum sit amet velit. + Suspendisse id sem consectetuer libero luctus adipiscing. + +But if you want to be lazy, you don't have to: + + * Lorem ipsum dolor sit amet, consectetuer adipiscing elit. + Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi, + viverra nec, fringilla in, laoreet vitae, risus. + * Donec sit amet nisl. Aliquam semper ipsum sit amet velit. + Suspendisse id sem consectetuer libero luctus adipiscing. + +If list items are separated by blank lines, Markdown will wrap the +items in `<p>` tags in the HTML output. For example, this input: + + * Bird + * Magic + +will turn into: + + <ul> + <li>Bird</li> + <li>Magic</li> + </ul> + +But this: + + * Bird + + * Magic + +will turn into: + + <ul> + <li><p>Bird</p></li> + <li><p>Magic</p></li> + </ul> + +List items may consist of multiple paragraphs. Each subsequent +paragraph in a list item must be intended by either 4 spaces +or one tab: + + 1. This is a list item with two paragraphs. Lorem ipsum dolor + sit amet, consectetuer adipiscing elit. Aliquam hendrerit + mi posuere lectus. + + Vestibulum enim wisi, viverra nec, fringilla in, laoreet + vitae, risus. Donec sit amet nisl. Aliquam semper ipsum + sit amet velit. + + 2. Suspendisse id sem consectetuer libero luctus adipiscing. + +It looks nice if you indent every line of the subsequent +paragraphs, but here again, Markdown will allow you to be +lazy: + + * This is a list item with two paragraphs. + + This is the second paragraph in the list item. You're + only required to indent the first line. Lorem ipsum dolor + sit amet, consectetuer adipiscing elit. + + * Another item in the same list. + +To put a blockquote within a list item, the blockquote's `>` +delimiters need to be indented: + + * A list item with a blockquote: + + > This is a blockquote + > inside a list item. + +To put a code block within a list item, the code block needs +to be indented *twice* -- 8 spaces or two tabs: + + * A list item with a code block: + + <code goes here> + + +It's worth noting that it's possible to trigger an ordered list by +accident, by writing something like this: + + 1986. What a great season. + +In other words, a *number-period-space* sequence at the beginning of a +line. To avoid this, you can backslash-escape the period: + + 1986\. What a great season. + + + +<h3 id="precode">Code Blocks</h3> + +Pre-formatted code blocks are used for writing about programming or +markup source code. Rather than forming normal paragraphs, the lines +of a code block are interpreted literally. Markdown wraps a code block +in both `<pre>` and `<code>` tags. + +To produce a code block in Markdown, simply indent every line of the +block by at least 4 spaces or 1 tab. For example, given this input: + + This is a normal paragraph: + + This is a code block. + +Markdown will generate: + + <p>This is a normal paragraph:</p> + + <pre><code>This is a code block. + </code></pre> + +One level of indentation -- 4 spaces or 1 tab -- is removed from each +line of the code block. For example, this: + + Here is an example of AppleScript: + + tell application "Foo" + beep + end tell + +will turn into: + + <p>Here is an example of AppleScript:</p> + + <pre><code>tell application "Foo" + beep + end tell + </code></pre> + +A code block continues until it reaches a line that is not indented +(or the end of the article). + +Within a code block, ampersands (`&`) and angle brackets (`<` and `>`) +are automatically converted into HTML entities. This makes it very +easy to include example HTML source code using Markdown -- just paste +it and indent it, and Markdown will handle the hassle of encoding the +ampersands and angle brackets. For example, this: + + <div class="footer"> + © 2004 Foo Corporation + </div> + +will turn into: + + <pre><code><div class="footer"> + &copy; 2004 Foo Corporation + </div> + </code></pre> + +Regular Markdown syntax is not processed within code blocks. E.g., +asterisks are just literal asterisks within a code block. This means +it's also easy to use Markdown to write about Markdown's own syntax. + + + +<h3 id="hr">Horizontal Rules</h3> + +You can produce a horizontal rule tag (`<hr />`) by placing three or +more hyphens, asterisks, or underscores on a line by themselves. If you +wish, you may use spaces between the hyphens or asterisks. Each of the +following lines will produce a horizontal rule: + + * * * + + *** + + ***** + + - - - + + --------------------------------------- + + _ _ _ + + +* * * + +<h2 id="span">Span Elements</h2> + +<h3 id="link">Links</h3> + +Markdown supports two style of links: *inline* and *reference*. + +In both styles, the link text is delimited by [square brackets]. + +To create an inline link, use a set of regular parentheses immediately +after the link text's closing square bracket. Inside the parentheses, +put the URL where you want the link to point, along with an *optional* +title for the link, surrounded in quotes. For example: + + This is [an example](http://example.com/ "Title") inline link. + + [This link](http://example.net/) has no title attribute. + +Will produce: + + <p>This is <a href="http://example.com/" title="Title"> + an example</a> inline link.</p> + + <p><a href="http://example.net/">This link</a> has no + title attribute.</p> + +If you're referring to a local resource on the same server, you can +use relative paths: + + See my [About](/about/) page for details. + +Reference-style links use a second set of square brackets, inside +which you place a label of your choosing to identify the link: + + This is [an example][id] reference-style link. + +You can optionally use a space to separate the sets of brackets: + + This is [an example] [id] reference-style link. + +Then, anywhere in the document, you define your link label like this, +on a line by itself: + + [id]: http://example.com/ "Optional Title Here" + +That is: + +* Square brackets containing the link identifier (optionally + indented from the left margin using up to three spaces); +* followed by a colon; +* followed by one or more spaces (or tabs); +* followed by the URL for the link; +* optionally followed by a title attribute for the link, enclosed + in double or single quotes. + +The link URL may, optionally, be surrounded by angle brackets: + + [id]: <http://example.com/> "Optional Title Here" + +You can put the title attribute on the next line and use extra spaces +or tabs for padding, which tends to look better with longer URLs: + + [id]: http://example.com/longish/path/to/resource/here + "Optional Title Here" + +Link definitions are only used for creating links during Markdown +processing, and are stripped from your document in the HTML output. + +Link definition names may constist of letters, numbers, spaces, and punctuation -- but they are *not* case sensitive. E.g. these two links: + + [link text][a] + [link text][A] + +are equivalent. + +The *implicit link name* shortcut allows you to omit the name of the +link, in which case the link text itself is used as the name. +Just use an empty set of square brackets -- e.g., to link the word +"Google" to the google.com web site, you could simply write: + + [Google][] + +And then define the link: + + [Google]: http://google.com/ + +Because link names may contain spaces, this shortcut even works for +multiple words in the link text: + + Visit [Daring Fireball][] for more information. + +And then define the link: + + [Daring Fireball]: http://daringfireball.net/ + +Link definitions can be placed anywhere in your Markdown document. I +tend to put them immediately after each paragraph in which they're +used, but if you want, you can put them all at the end of your +document, sort of like footnotes. + +Here's an example of reference links in action: + + I get 10 times more traffic from [Google] [1] than from + [Yahoo] [2] or [MSN] [3]. + + [1]: http://google.com/ "Google" + [2]: http://search.yahoo.com/ "Yahoo Search" + [3]: http://search.msn.com/ "MSN Search" + +Using the implicit link name shortcut, you could instead write: + + I get 10 times more traffic from [Google][] than from + [Yahoo][] or [MSN][]. + + [google]: http://google.com/ "Google" + [yahoo]: http://search.yahoo.com/ "Yahoo Search" + [msn]: http://search.msn.com/ "MSN Search" + +Both of the above examples will produce the following HTML output: + + <p>I get 10 times more traffic from <a href="http://google.com/" + title="Google">Google</a> than from + <a href="http://search.yahoo.com/" title="Yahoo Search">Yahoo</a> + or <a href="http://search.msn.com/" title="MSN Search">MSN</a>.</p> + +For comparison, here is the same paragraph written using +Markdown's inline link style: + + I get 10 times more traffic from [Google](http://google.com/ "Google") + than from [Yahoo](http://search.yahoo.com/ "Yahoo Search") or + [MSN](http://search.msn.com/ "MSN Search"). + +The point of reference-style links is not that they're easier to +write. The point is that with reference-style links, your document +source is vastly more readable. Compare the above examples: using +reference-style links, the paragraph itself is only 81 characters +long; with inline-style links, it's 176 characters; and as raw HTML, +it's 234 characters. In the raw HTML, there's more markup than there +is text. + +With Markdown's reference-style links, a source document much more +closely resembles the final output, as rendered in a browser. By +allowing you to move the markup-related metadata out of the paragraph, +you can add links without interrupting the narrative flow of your +prose. + + +<h3 id="em">Emphasis</h3> + +Markdown treats asterisks (`*`) and underscores (`_`) as indicators of +emphasis. Text wrapped with one `*` or `_` will be wrapped with an +HTML `<em>` tag; double `*`'s or `_`'s will be wrapped with an HTML +`<strong>` tag. E.g., this input: + + *single asterisks* + + _single underscores_ + + **double asterisks** + + __double underscores__ + +will produce: + + <em>single asterisks</em> + + <em>single underscores</em> + + <strong>double asterisks</strong> + + <strong>double underscores</strong> + +You can use whichever style you prefer; the lone restriction is that +the same character must be used to open and close an emphasis span. + +Emphasis can be used in the middle of a word: + + un*fucking*believable + +But if you surround an `*` or `_` with spaces, it'll be treated as a +literal asterisk or underscore. + +To produce a literal asterisk or underscore at a position where it +would otherwise be used as an emphasis delimiter, you can backslash +escape it: + + \*this text is surrounded by literal asterisks\* + + + +<h3 id="code">Code</h3> + +To indicate a span of code, wrap it with backtick quotes (`` ` ``). +Unlike a pre-formatted code block, a code span indicates code within a +normal paragraph. For example: + + Use the `printf()` function. + +will produce: + + <p>Use the <code>printf()</code> function.</p> + +To include a literal backtick character within a code span, you can use +multiple backticks as the opening and closing delimiters: + + ``There is a literal backtick (`) here.`` + +which will produce this: + + <p><code>There is a literal backtick (`) here.</code></p> + +The backtick delimiters surrounding a code span may include spaces -- +one after the opening, one before the closing. This allows you to place +literal backtick characters at the beginning or end of a code span: + + A single backtick in a code span: `` ` `` + + A backtick-delimited string in a code span: `` `foo` `` + +will produce: + + <p>A single backtick in a code span: <code>`</code></p> + + <p>A backtick-delimited string in a code span: <code>`foo`</code></p> + +With a code span, ampersands and angle brackets are encoded as HTML +entities automatically, which makes it easy to include example HTML +tags. Markdown will turn this: + + Please don't use any `<blink>` tags. + +into: + + <p>Please don't use any <code><blink></code> tags.</p> + +You can write this: + + `—` is the decimal-encoded equivalent of `—`. + +to produce: + + <p><code>&#8212;</code> is the decimal-encoded + equivalent of <code>&mdash;</code>.</p> + + + +<h3 id="img">Images</h3> + +Admittedly, it's fairly difficult to devise a "natural" syntax for +placing images into a plain text document format. + +Markdown uses an image syntax that is intended to resemble the syntax +for links, allowing for two styles: *inline* and *reference*. + +Inline image syntax looks like this: + +  + +  + +That is: + +* An exclamation mark: `!`; +* followed by a set of square brackets, containing the `alt` + attribute text for the image; +* followed by a set of parentheses, containing the URL or path to + the image, and an optional `title` attribute enclosed in double + or single quotes. + +Reference-style image syntax looks like this: + + ![Alt text][id] + +Where "id" is the name of a defined image reference. Image references +are defined using syntax identical to link references: + + [id]: url/to/image "Optional title attribute" + +As of this writing, Markdown has no syntax for specifying the +dimensions of an image; if this is important to you, you can simply +use regular HTML `<img>` tags. + + +* * * + + +<h2 id="misc">Miscellaneous</h2> + +<h3 id="autolink">Automatic Links</h3> + +Markdown supports a shortcut style for creating "automatic" links for URLs and email addresses: simply surround the URL or email address with angle brackets. What this means is that if you want to show the actual text of a URL or email address, and also have it be a clickable link, you can do this: + + <http://example.com/> + +Markdown will turn this into: + + <a href="http://example.com/">http://example.com/</a> + +Automatic links for email addresses work similarly, except that +Markdown will also perform a bit of randomized decimal and hex +entity-encoding to help obscure your address from address-harvesting +spambots. For example, Markdown will turn this: + + <address@example.com> + +into something like this: + + <a href="mailto:addre + ss@example.co + m">address@exa + mple.com</a> + +which will render in a browser as a clickable link to "address@example.com". + +(This sort of entity-encoding trick will indeed fool many, if not +most, address-harvesting bots, but it definitely won't fool all of +them. It's better than nothing, but an address published in this way +will probably eventually start receiving spam.) + + + +<h3 id="backslash">Backslash Escapes</h3> + +Markdown allows you to use backslash escapes to generate literal +characters which would otherwise have special meaning in Markdown's +formatting syntax. For example, if you wanted to surround a word with +literal asterisks (instead of an HTML `<em>` tag), you can backslashes +before the asterisks, like this: + + \*literal asterisks\* + +Markdown provides backslash escapes for the following characters: + + \ backslash + ` backtick + * asterisk + _ underscore + {} curly braces + [] square brackets + () parentheses + # hash mark + + plus sign + - minus sign (hyphen) + . dot + ! exclamation mark + diff --git a/t/Markdown-from-MDTest1.1.mdtest/Markdown_Documentation_-_Syntax.xhtml b/t/Markdown-from-MDTest1.1.mdtest/Markdown_Documentation_-_Syntax.xhtml new file mode 100644 index 0000000..5c01306 --- /dev/null +++ b/t/Markdown-from-MDTest1.1.mdtest/Markdown_Documentation_-_Syntax.xhtml @@ -0,0 +1,942 @@ +<h1>Markdown: Syntax</h1> + +<ul id="ProjectSubmenu"> + <li><a href="/projects/markdown/" title="Markdown Project Page">Main</a></li> + <li><a href="/projects/markdown/basics" title="Markdown Basics">Basics</a></li> + <li><a class="selected" title="Markdown Syntax Documentation">Syntax</a></li> + <li><a href="/projects/markdown/license" title="Pricing and License Information">License</a></li> + <li><a href="/projects/markdown/dingus" title="Online Markdown Web Form">Dingus</a></li> +</ul> + +<ul> +<li><a href="#overview">Overview</a> +<ul> +<li><a href="#philosophy">Philosophy</a></li> +<li><a href="#html">Inline HTML</a></li> +<li><a href="#autoescape">Automatic Escaping for Special Characters</a></li> +</ul></li> +<li><a href="#block">Block Elements</a> +<ul> +<li><a href="#p">Paragraphs and Line Breaks</a></li> +<li><a href="#header">Headers</a></li> +<li><a href="#blockquote">Blockquotes</a></li> +<li><a href="#list">Lists</a></li> +<li><a href="#precode">Code Blocks</a></li> +<li><a href="#hr">Horizontal Rules</a></li> +</ul></li> +<li><a href="#span">Span Elements</a> +<ul> +<li><a href="#link">Links</a></li> +<li><a href="#em">Emphasis</a></li> +<li><a href="#code">Code</a></li> +<li><a href="#img">Images</a></li> +</ul></li> +<li><a href="#misc">Miscellaneous</a> +<ul> +<li><a href="#backslash">Backslash Escapes</a></li> +<li><a href="#autolink">Automatic Links</a></li> +</ul></li> +</ul> + +<p><strong>Note:</strong> This document is itself written using Markdown; you +can <a href="/projects/markdown/syntax.text">see the source for it by adding '.text' to the URL</a>.</p> + +<hr /> + +<h2 id="overview">Overview</h2> + +<h3 id="philosophy">Philosophy</h3> + +<p>Markdown is intended to be as easy-to-read and easy-to-write as is feasible.</p> + +<p>Readability, however, is emphasized above all else. A Markdown-formatted +document should be publishable as-is, as plain text, without looking +like it's been marked up with tags or formatting instructions. While +Markdown's syntax has been influenced by several existing text-to-HTML +filters -- including <a href="http://docutils.sourceforge.net/mirror/setext.html">Setext</a>, <a href="http://www.aaronsw.com/2002/atx/">atx</a>, <a href="http://textism.com/tools/textile/">Textile</a>, <a href="http://docutils.sourceforge.net/rst.html">reStructuredText</a>, +<a href="http://www.triptico.com/software/grutatxt.html">Grutatext</a>, and <a href="http://ettext.taint.org/doc/">EtText</a> -- the single biggest source of +inspiration for Markdown's syntax is the format of plain text email.</p> + +<p>To this end, Markdown's syntax is comprised entirely of punctuation +characters, which punctuation characters have been carefully chosen so +as to look like what they mean. E.g., asterisks around a word actually +look like *emphasis*. Markdown lists look like, well, lists. Even +blockquotes look like quoted passages of text, assuming you've ever +used email.</p> + +<h3 id="html">Inline HTML</h3> + +<p>Markdown's syntax is intended for one purpose: to be used as a +format for <em>writing</em> for the web.</p> + +<p>Markdown is not a replacement for HTML, or even close to it. Its +syntax is very small, corresponding only to a very small subset of +HTML tags. The idea is <em>not</em> to create a syntax that makes it easier +to insert HTML tags. In my opinion, HTML tags are already easy to +insert. The idea for Markdown is to make it easy to read, write, and +edit prose. HTML is a <em>publishing</em> format; Markdown is a <em>writing</em> +format. Thus, Markdown's formatting syntax only addresses issues that +can be conveyed in plain text.</p> + +<p>For any markup that is not covered by Markdown's syntax, you simply +use HTML itself. There's no need to preface it or delimit it to +indicate that you're switching from Markdown to HTML; you just use +the tags.</p> + +<p>The only restrictions are that block-level HTML elements -- e.g. <code><div></code>, +<code><table></code>, <code><pre></code>, <code><p></code>, etc. -- must be separated from surrounding +content by blank lines, and the start and end tags of the block should +not be indented with tabs or spaces. Markdown is smart enough not +to add extra (unwanted) <code><p></code> tags around HTML block-level tags.</p> + +<p>For example, to add an HTML table to a Markdown article:</p> + +<pre><code>This is a regular paragraph. + +<table> + <tr> + <td>Foo</td> + </tr> +</table> + +This is another regular paragraph. +</code></pre> + +<p>Note that Markdown formatting syntax is not processed within block-level +HTML tags. E.g., you can't use Markdown-style <code>*emphasis*</code> inside an +HTML block.</p> + +<p>Span-level HTML tags -- e.g. <code><span></code>, <code><cite></code>, or <code><del></code> -- can be +used anywhere in a Markdown paragraph, list item, or header. If you +want, you can even use HTML tags instead of Markdown formatting; e.g. if +you'd prefer to use HTML <code><a></code> or <code><img></code> tags instead of Markdown's +link or image syntax, go right ahead.</p> + +<p>Unlike block-level HTML tags, Markdown syntax <em>is</em> processed within +span-level tags.</p> + +<h3 id="autoescape">Automatic Escaping for Special Characters</h3> + +<p>In HTML, there are two characters that demand special treatment: <code><</code> +and <code>&</code>. Left angle brackets are used to start tags; ampersands are +used to denote HTML entities. If you want to use them as literal +characters, you must escape them as entities, e.g. <code>&lt;</code>, and +<code>&amp;</code>.</p> + +<p>Ampersands in particular are bedeviling for web writers. If you want to +write about 'AT&T', you need to write '<code>AT&amp;T</code>'. You even need to +escape ampersands within URLs. Thus, if you want to link to:</p> + +<pre><code>http://images.google.com/images?num=30&q=larry+bird +</code></pre> + +<p>you need to encode the URL as:</p> + +<pre><code>http://images.google.com/images?num=30&amp;q=larry+bird +</code></pre> + +<p>in your anchor tag <code>href</code> attribute. Needless to say, this is easy to +forget, and is probably the single most common source of HTML validation +errors in otherwise well-marked-up web sites.</p> + +<p>Markdown allows you to use these characters naturally, taking care of +all the necessary escaping for you. If you use an ampersand as part of +an HTML entity, it remains unchanged; otherwise it will be translated +into <code>&amp;</code>.</p> + +<p>So, if you want to include a copyright symbol in your article, you can write:</p> + +<pre><code>&copy; +</code></pre> + +<p>and Markdown will leave it alone. But if you write:</p> + +<pre><code>AT&T +</code></pre> + +<p>Markdown will translate it to:</p> + +<pre><code>AT&amp;T +</code></pre> + +<p>Similarly, because Markdown supports <a href="#html">inline HTML</a>, if you use +angle brackets as delimiters for HTML tags, Markdown will treat them as +such. But if you write:</p> + +<pre><code>4 < 5 +</code></pre> + +<p>Markdown will translate it to:</p> + +<pre><code>4 &lt; 5 +</code></pre> + +<p>However, inside Markdown code spans and blocks, angle brackets and +ampersands are <em>always</em> encoded automatically. This makes it easy to use +Markdown to write about HTML code. (As opposed to raw HTML, which is a +terrible format for writing about HTML syntax, because every single <code><</code> +and <code>&</code> in your example code needs to be escaped.)</p> + +<hr /> + +<h2 id="block">Block Elements</h2> + +<h3 id="p">Paragraphs and Line Breaks</h3> + +<p>A paragraph is simply one or more consecutive lines of text, separated +by one or more blank lines. (A blank line is any line that looks like a +blank line -- a line containing nothing but spaces or tabs is considered +blank.) Normal paragraphs should not be intended with spaces or tabs.</p> + +<p>The implication of the "one or more consecutive lines of text" rule is +that Markdown supports "hard-wrapped" text paragraphs. This differs +significantly from most other text-to-HTML formatters (including Movable +Type's "Convert Line Breaks" option) which translate every line break +character in a paragraph into a <code><br /></code> tag.</p> + +<p>When you <em>do</em> want to insert a <code><br /></code> break tag using Markdown, you +end a line with two or more spaces, then type return.</p> + +<p>Yes, this takes a tad more effort to create a <code><br /></code>, but a simplistic +"every line break is a <code><br /></code>" rule wouldn't work for Markdown. +Markdown's email-style <a href="#blockquote">blockquoting</a> and multi-paragraph <a href="#list">list items</a> +work best -- and look better -- when you format them with hard breaks.</p> + +<h3 id="header">Headers</h3> + +<p>Markdown supports two styles of headers, <a href="http://docutils.sourceforge.net/mirror/setext.html">Setext</a> and <a href="http://www.aaronsw.com/2002/atx/">atx</a>.</p> + +<p>Setext-style headers are "underlined" using equal signs (for first-level +headers) and dashes (for second-level headers). For example:</p> + +<pre><code>This is an H1 +============= + +This is an H2 +------------- +</code></pre> + +<p>Any number of underlining <code>=</code>'s or <code>-</code>'s will work.</p> + +<p>Atx-style headers use 1-6 hash characters at the start of the line, +corresponding to header levels 1-6. For example:</p> + +<pre><code># This is an H1 + +## This is an H2 + +###### This is an H6 +</code></pre> + +<p>Optionally, you may "close" atx-style headers. This is purely +cosmetic -- you can use this if you think it looks better. The +closing hashes don't even need to match the number of hashes +used to open the header. (The number of opening hashes +determines the header level.) :</p> + +<pre><code># This is an H1 # + +## This is an H2 ## + +### This is an H3 ###### +</code></pre> + +<h3 id="blockquote">Blockquotes</h3> + +<p>Markdown uses email-style <code>></code> characters for blockquoting. If you're +familiar with quoting passages of text in an email message, then you +know how to create a blockquote in Markdown. It looks best if you hard +wrap the text and put a <code>></code> before every line:</p> + +<pre><code>> This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet, +> consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus. +> Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus. +> +> Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse +> id sem consectetuer libero luctus adipiscing. +</code></pre> + +<p>Markdown allows you to be lazy and only put the <code>></code> before the first +line of a hard-wrapped paragraph:</p> + +<pre><code>> This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet, +consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus. +Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus. + +> Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse +id sem consectetuer libero luctus adipiscing. +</code></pre> + +<p>Blockquotes can be nested (i.e. a blockquote-in-a-blockquote) by +adding additional levels of <code>></code>:</p> + +<pre><code>> This is the first level of quoting. +> +> > This is nested blockquote. +> +> Back to the first level. +</code></pre> + +<p>Blockquotes can contain other Markdown elements, including headers, lists, +and code blocks:</p> + +<pre><code>> ## This is a header. +> +> 1. This is the first list item. +> 2. This is the second list item. +> +> Here's some example code: +> +> return shell_exec("echo $input | $markdown_script"); +</code></pre> + +<p>Any decent text editor should make email-style quoting easy. For +example, with BBEdit, you can make a selection and choose Increase +Quote Level from the Text menu.</p> + +<h3 id="list">Lists</h3> + +<p>Markdown supports ordered (numbered) and unordered (bulleted) lists.</p> + +<p>Unordered lists use asterisks, pluses, and hyphens -- interchangably +-- as list markers:</p> + +<pre><code>* Red +* Green +* Blue +</code></pre> + +<p>is equivalent to:</p> + +<pre><code>+ Red ++ Green ++ Blue +</code></pre> + +<p>and:</p> + +<pre><code>- Red +- Green +- Blue +</code></pre> + +<p>Ordered lists use numbers followed by periods:</p> + +<pre><code>1. Bird +2. McHale +3. Parish +</code></pre> + +<p>It's important to note that the actual numbers you use to mark the +list have no effect on the HTML output Markdown produces. The HTML +Markdown produces from the above list is:</p> + +<pre><code><ol> +<li>Bird</li> +<li>McHale</li> +<li>Parish</li> +</ol> +</code></pre> + +<p>If you instead wrote the list in Markdown like this:</p> + +<pre><code>1. Bird +1. McHale +1. Parish +</code></pre> + +<p>or even:</p> + +<pre><code>3. Bird +1. McHale +8. Parish +</code></pre> + +<p>you'd get the exact same HTML output. The point is, if you want to, +you can use ordinal numbers in your ordered Markdown lists, so that +the numbers in your source match the numbers in your published HTML. +But if you want to be lazy, you don't have to.</p> + +<p>If you do use lazy list numbering, however, you should still start the +list with the number 1. At some point in the future, Markdown may support +starting ordered lists at an arbitrary number.</p> + +<p>List markers typically start at the left margin, but may be indented by +up to three spaces. List markers must be followed by one or more spaces +or a tab.</p> + +<p>To make lists look nice, you can wrap items with hanging indents:</p> + +<pre><code>* Lorem ipsum dolor sit amet, consectetuer adipiscing elit. + Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi, + viverra nec, fringilla in, laoreet vitae, risus. +* Donec sit amet nisl. Aliquam semper ipsum sit amet velit. + Suspendisse id sem consectetuer libero luctus adipiscing. +</code></pre> + +<p>But if you want to be lazy, you don't have to:</p> + +<pre><code>* Lorem ipsum dolor sit amet, consectetuer adipiscing elit. +Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi, +viverra nec, fringilla in, laoreet vitae, risus. +* Donec sit amet nisl. Aliquam semper ipsum sit amet velit. +Suspendisse id sem consectetuer libero luctus adipiscing. +</code></pre> + +<p>If list items are separated by blank lines, Markdown will wrap the +items in <code><p></code> tags in the HTML output. For example, this input:</p> + +<pre><code>* Bird +* Magic +</code></pre> + +<p>will turn into:</p> + +<pre><code><ul> +<li>Bird</li> +<li>Magic</li> +</ul> +</code></pre> + +<p>But this:</p> + +<pre><code>* Bird + +* Magic +</code></pre> + +<p>will turn into:</p> + +<pre><code><ul> +<li><p>Bird</p></li> +<li><p>Magic</p></li> +</ul> +</code></pre> + +<p>List items may consist of multiple paragraphs. Each subsequent +paragraph in a list item must be intended by either 4 spaces +or one tab:</p> + +<pre><code>1. This is a list item with two paragraphs. Lorem ipsum dolor + sit amet, consectetuer adipiscing elit. Aliquam hendrerit + mi posuere lectus. + + Vestibulum enim wisi, viverra nec, fringilla in, laoreet + vitae, risus. Donec sit amet nisl. Aliquam semper ipsum + sit amet velit. + +2. Suspendisse id sem consectetuer libero luctus adipiscing. +</code></pre> + +<p>It looks nice if you indent every line of the subsequent +paragraphs, but here again, Markdown will allow you to be +lazy:</p> + +<pre><code>* This is a list item with two paragraphs. + + This is the second paragraph in the list item. You're +only required to indent the first line. Lorem ipsum dolor +sit amet, consectetuer adipiscing elit. + +* Another item in the same list. +</code></pre> + +<p>To put a blockquote within a list item, the blockquote's <code>></code> +delimiters need to be indented:</p> + +<pre><code>* A list item with a blockquote: + + > This is a blockquote + > inside a list item. +</code></pre> + +<p>To put a code block within a list item, the code block needs +to be indented <em>twice</em> -- 8 spaces or two tabs:</p> + +<pre><code>* A list item with a code block: + + <code goes here> +</code></pre> + +<p>It's worth noting that it's possible to trigger an ordered list by +accident, by writing something like this:</p> + +<pre><code>1986. What a great season. +</code></pre> + +<p>In other words, a <em>number-period-space</em> sequence at the beginning of a +line. To avoid this, you can backslash-escape the period:</p> + +<pre><code>1986\. What a great season. +</code></pre> + +<h3 id="precode">Code Blocks</h3> + +<p>Pre-formatted code blocks are used for writing about programming or +markup source code. Rather than forming normal paragraphs, the lines +of a code block are interpreted literally. Markdown wraps a code block +in both <code><pre></code> and <code><code></code> tags.</p> + +<p>To produce a code block in Markdown, simply indent every line of the +block by at least 4 spaces or 1 tab. For example, given this input:</p> + +<pre><code>This is a normal paragraph: + + This is a code block. +</code></pre> + +<p>Markdown will generate:</p> + +<pre><code><p>This is a normal paragraph:</p> + +<pre><code>This is a code block. +</code></pre> +</code></pre> + +<p>One level of indentation -- 4 spaces or 1 tab -- is removed from each +line of the code block. For example, this:</p> + +<pre><code>Here is an example of AppleScript: + + tell application "Foo" + beep + end tell +</code></pre> + +<p>will turn into:</p> + +<pre><code><p>Here is an example of AppleScript:</p> + +<pre><code>tell application "Foo" + beep +end tell +</code></pre> +</code></pre> + +<p>A code block continues until it reaches a line that is not indented +(or the end of the article).</p> + +<p>Within a code block, ampersands (<code>&</code>) and angle brackets (<code><</code> and <code>></code>) +are automatically converted into HTML entities. This makes it very +easy to include example HTML source code using Markdown -- just paste +it and indent it, and Markdown will handle the hassle of encoding the +ampersands and angle brackets. For example, this:</p> + +<pre><code> <div class="footer"> + &copy; 2004 Foo Corporation + </div> +</code></pre> + +<p>will turn into:</p> + +<pre><code><pre><code>&lt;div class="footer"&gt; + &amp;copy; 2004 Foo Corporation +&lt;/div&gt; +</code></pre> +</code></pre> + +<p>Regular Markdown syntax is not processed within code blocks. E.g., +asterisks are just literal asterisks within a code block. This means +it's also easy to use Markdown to write about Markdown's own syntax.</p> + +<h3 id="hr">Horizontal Rules</h3> + +<p>You can produce a horizontal rule tag (<code><hr /></code>) by placing three or +more hyphens, asterisks, or underscores on a line by themselves. If you +wish, you may use spaces between the hyphens or asterisks. Each of the +following lines will produce a horizontal rule:</p> + +<pre><code>* * * + +*** + +***** + +- - - + +--------------------------------------- + +_ _ _ +</code></pre> + +<hr /> + +<h2 id="span">Span Elements</h2> + +<h3 id="link">Links</h3> + +<p>Markdown supports two style of links: <em>inline</em> and <em>reference</em>.</p> + +<p>In both styles, the link text is delimited by [square brackets].</p> + +<p>To create an inline link, use a set of regular parentheses immediately +after the link text's closing square bracket. Inside the parentheses, +put the URL where you want the link to point, along with an <em>optional</em> +title for the link, surrounded in quotes. For example:</p> + +<pre><code>This is [an example](http://example.com/ "Title") inline link. + +[This link](http://example.net/) has no title attribute. +</code></pre> + +<p>Will produce:</p> + +<pre><code><p>This is <a href="http://example.com/" title="Title"> +an example</a> inline link.</p> + +<p><a href="http://example.net/">This link</a> has no +title attribute.</p> +</code></pre> + +<p>If you're referring to a local resource on the same server, you can +use relative paths:</p> + +<pre><code>See my [About](/about/) page for details. +</code></pre> + +<p>Reference-style links use a second set of square brackets, inside +which you place a label of your choosing to identify the link:</p> + +<pre><code>This is [an example][id] reference-style link. +</code></pre> + +<p>You can optionally use a space to separate the sets of brackets:</p> + +<pre><code>This is [an example] [id] reference-style link. +</code></pre> + +<p>Then, anywhere in the document, you define your link label like this, +on a line by itself:</p> + +<pre><code>[id]: http://example.com/ "Optional Title Here" +</code></pre> + +<p>That is:</p> + +<ul> +<li>Square brackets containing the link identifier (optionally +indented from the left margin using up to three spaces);</li> +<li>followed by a colon;</li> +<li>followed by one or more spaces (or tabs);</li> +<li>followed by the URL for the link;</li> +<li>optionally followed by a title attribute for the link, enclosed +in double or single quotes.</li> +</ul> + +<p>The link URL may, optionally, be surrounded by angle brackets:</p> + +<pre><code>[id]: <http://example.com/> "Optional Title Here" +</code></pre> + +<p>You can put the title attribute on the next line and use extra spaces +or tabs for padding, which tends to look better with longer URLs:</p> + +<pre><code>[id]: http://example.com/longish/path/to/resource/here + "Optional Title Here" +</code></pre> + +<p>Link definitions are only used for creating links during Markdown +processing, and are stripped from your document in the HTML output.</p> + +<p>Link definition names may constist of letters, numbers, spaces, and punctuation -- but they are <em>not</em> case sensitive. E.g. these two links:</p> + +<pre><code>[link text][a] +[link text][A] +</code></pre> + +<p>are equivalent.</p> + +<p>The <em>implicit link name</em> shortcut allows you to omit the name of the +link, in which case the link text itself is used as the name. +Just use an empty set of square brackets -- e.g., to link the word +"Google" to the google.com web site, you could simply write:</p> + +<pre><code>[Google][] +</code></pre> + +<p>And then define the link:</p> + +<pre><code>[Google]: http://google.com/ +</code></pre> + +<p>Because link names may contain spaces, this shortcut even works for +multiple words in the link text:</p> + +<pre><code>Visit [Daring Fireball][] for more information. +</code></pre> + +<p>And then define the link:</p> + +<pre><code>[Daring Fireball]: http://daringfireball.net/ +</code></pre> + +<p>Link definitions can be placed anywhere in your Markdown document. I +tend to put them immediately after each paragraph in which they're +used, but if you want, you can put them all at the end of your +document, sort of like footnotes.</p> + +<p>Here's an example of reference links in action:</p> + +<pre><code>I get 10 times more traffic from [Google] [1] than from +[Yahoo] [2] or [MSN] [3]. + + [1]: http://google.com/ "Google" + [2]: http://search.yahoo.com/ "Yahoo Search" + [3]: http://search.msn.com/ "MSN Search" +</code></pre> + +<p>Using the implicit link name shortcut, you could instead write:</p> + +<pre><code>I get 10 times more traffic from [Google][] than from +[Yahoo][] or [MSN][]. + + [google]: http://google.com/ "Google" + [yahoo]: http://search.yahoo.com/ "Yahoo Search" + [msn]: http://search.msn.com/ "MSN Search" +</code></pre> + +<p>Both of the above examples will produce the following HTML output:</p> + +<pre><code><p>I get 10 times more traffic from <a href="http://google.com/" +title="Google">Google</a> than from +<a href="http://search.yahoo.com/" title="Yahoo Search">Yahoo</a> +or <a href="http://search.msn.com/" title="MSN Search">MSN</a>.</p> +</code></pre> + +<p>For comparison, here is the same paragraph written using +Markdown's inline link style:</p> + +<pre><code>I get 10 times more traffic from [Google](http://google.com/ "Google") +than from [Yahoo](http://search.yahoo.com/ "Yahoo Search") or +[MSN](http://search.msn.com/ "MSN Search"). +</code></pre> + +<p>The point of reference-style links is not that they're easier to +write. The point is that with reference-style links, your document +source is vastly more readable. Compare the above examples: using +reference-style links, the paragraph itself is only 81 characters +long; with inline-style links, it's 176 characters; and as raw HTML, +it's 234 characters. In the raw HTML, there's more markup than there +is text.</p> + +<p>With Markdown's reference-style links, a source document much more +closely resembles the final output, as rendered in a browser. By +allowing you to move the markup-related metadata out of the paragraph, +you can add links without interrupting the narrative flow of your +prose.</p> + +<h3 id="em">Emphasis</h3> + +<p>Markdown treats asterisks (<code>*</code>) and underscores (<code>_</code>) as indicators of +emphasis. Text wrapped with one <code>*</code> or <code>_</code> will be wrapped with an +HTML <code><em></code> tag; double <code>*</code>'s or <code>_</code>'s will be wrapped with an HTML +<code><strong></code> tag. E.g., this input:</p> + +<pre><code>*single asterisks* + +_single underscores_ + +**double asterisks** + +__double underscores__ +</code></pre> + +<p>will produce:</p> + +<pre><code><em>single asterisks</em> + +<em>single underscores</em> + +<strong>double asterisks</strong> + +<strong>double underscores</strong> +</code></pre> + +<p>You can use whichever style you prefer; the lone restriction is that +the same character must be used to open and close an emphasis span.</p> + +<p>Emphasis can be used in the middle of a word:</p> + +<pre><code>un*fucking*believable +</code></pre> + +<p>But if you surround an <code>*</code> or <code>_</code> with spaces, it'll be treated as a +literal asterisk or underscore.</p> + +<p>To produce a literal asterisk or underscore at a position where it +would otherwise be used as an emphasis delimiter, you can backslash +escape it:</p> + +<pre><code>\*this text is surrounded by literal asterisks\* +</code></pre> + +<h3 id="code">Code</h3> + +<p>To indicate a span of code, wrap it with backtick quotes (<code>`</code>). +Unlike a pre-formatted code block, a code span indicates code within a +normal paragraph. For example:</p> + +<pre><code>Use the `printf()` function. +</code></pre> + +<p>will produce:</p> + +<pre><code><p>Use the <code>printf()</code> function.</p> +</code></pre> + +<p>To include a literal backtick character within a code span, you can use +multiple backticks as the opening and closing delimiters:</p> + +<pre><code>``There is a literal backtick (`) here.`` +</code></pre> + +<p>which will produce this:</p> + +<pre><code><p><code>There is a literal backtick (`) here.</code></p> +</code></pre> + +<p>The backtick delimiters surrounding a code span may include spaces -- +one after the opening, one before the closing. This allows you to place +literal backtick characters at the beginning or end of a code span:</p> + +<pre><code>A single backtick in a code span: `` ` `` + +A backtick-delimited string in a code span: `` `foo` `` +</code></pre> + +<p>will produce:</p> + +<pre><code><p>A single backtick in a code span: <code>`</code></p> + +<p>A backtick-delimited string in a code span: <code>`foo`</code></p> +</code></pre> + +<p>With a code span, ampersands and angle brackets are encoded as HTML +entities automatically, which makes it easy to include example HTML +tags. Markdown will turn this:</p> + +<pre><code>Please don't use any `<blink>` tags. +</code></pre> + +<p>into:</p> + +<pre><code><p>Please don't use any <code>&lt;blink&gt;</code> tags.</p> +</code></pre> + +<p>You can write this:</p> + +<pre><code>`&#8212;` is the decimal-encoded equivalent of `&mdash;`. +</code></pre> + +<p>to produce:</p> + +<pre><code><p><code>&amp;#8212;</code> is the decimal-encoded +equivalent of <code>&amp;mdash;</code>.</p> +</code></pre> + +<h3 id="img">Images</h3> + +<p>Admittedly, it's fairly difficult to devise a "natural" syntax for +placing images into a plain text document format.</p> + +<p>Markdown uses an image syntax that is intended to resemble the syntax +for links, allowing for two styles: <em>inline</em> and <em>reference</em>.</p> + +<p>Inline image syntax looks like this:</p> + +<pre><code> + + +</code></pre> + +<p>That is:</p> + +<ul> +<li>An exclamation mark: <code>!</code>;</li> +<li>followed by a set of square brackets, containing the <code>alt</code> +attribute text for the image;</li> +<li>followed by a set of parentheses, containing the URL or path to +the image, and an optional <code>title</code> attribute enclosed in double +or single quotes.</li> +</ul> + +<p>Reference-style image syntax looks like this:</p> + +<pre><code>![Alt text][id] +</code></pre> + +<p>Where "id" is the name of a defined image reference. Image references +are defined using syntax identical to link references:</p> + +<pre><code>[id]: url/to/image "Optional title attribute" +</code></pre> + +<p>As of this writing, Markdown has no syntax for specifying the +dimensions of an image; if this is important to you, you can simply +use regular HTML <code><img></code> tags.</p> + +<hr /> + +<h2 id="misc">Miscellaneous</h2> + +<h3 id="autolink">Automatic Links</h3> + +<p>Markdown supports a shortcut style for creating "automatic" links for URLs and email addresses: simply surround the URL or email address with angle brackets. What this means is that if you want to show the actual text of a URL or email address, and also have it be a clickable link, you can do this:</p> + +<pre><code><http://example.com/> +</code></pre> + +<p>Markdown will turn this into:</p> + +<pre><code><a href="http://example.com/">http://example.com/</a> +</code></pre> + +<p>Automatic links for email addresses work similarly, except that +Markdown will also perform a bit of randomized decimal and hex +entity-encoding to help obscure your address from address-harvesting +spambots. For example, Markdown will turn this:</p> + +<pre><code><address@example.com> +</code></pre> + +<p>into something like this:</p> + +<pre><code><a href="&#x6D;&#x61;i&#x6C;&#x74;&#x6F;:&#x61;&#x64;&#x64;&#x72;&#x65; +&#115;&#115;&#64;&#101;&#120;&#x61;&#109;&#x70;&#x6C;e&#x2E;&#99;&#111; +&#109;">&#x61;&#x64;&#x64;&#x72;&#x65;&#115;&#115;&#64;&#101;&#120;&#x61; +&#109;&#x70;&#x6C;e&#x2E;&#99;&#111;&#109;</a> +</code></pre> + +<p>which will render in a browser as a clickable link to "address@example.com".</p> + +<p>(This sort of entity-encoding trick will indeed fool many, if not +most, address-harvesting bots, but it definitely won't fool all of +them. It's better than nothing, but an address published in this way +will probably eventually start receiving spam.)</p> + +<h3 id="backslash">Backslash Escapes</h3> + +<p>Markdown allows you to use backslash escapes to generate literal +characters which would otherwise have special meaning in Markdown's +formatting syntax. For example, if you wanted to surround a word with +literal asterisks (instead of an HTML <code><em></code> tag), you can backslashes +before the asterisks, like this:</p> + +<pre><code>\*literal asterisks\* +</code></pre> + +<p>Markdown provides backslash escapes for the following characters:</p> + +<pre><code>\ backslash +` backtick +* asterisk +_ underscore +{} curly braces +[] square brackets +() parentheses +# hash mark ++ plus sign +- minus sign (hyphen) +. dot +! exclamation mark +</code></pre> diff --git a/t/Markdown-from-MDTest1.1.mdtest/Nested_blockquotes.text b/t/Markdown-from-MDTest1.1.mdtest/Nested_blockquotes.text new file mode 100644 index 0000000..ed3c624 --- /dev/null +++ b/t/Markdown-from-MDTest1.1.mdtest/Nested_blockquotes.text @@ -0,0 +1,5 @@ +> foo +> +> > bar +> +> foo diff --git a/t/Markdown-from-MDTest1.1.mdtest/Nested_blockquotes.xhtml b/t/Markdown-from-MDTest1.1.mdtest/Nested_blockquotes.xhtml new file mode 100644 index 0000000..d8ec7f8 --- /dev/null +++ b/t/Markdown-from-MDTest1.1.mdtest/Nested_blockquotes.xhtml @@ -0,0 +1,9 @@ +<blockquote> + <p>foo</p> + + <blockquote> + <p>bar</p> + </blockquote> + + <p>foo</p> +</blockquote> diff --git a/t/Markdown-from-MDTest1.1.mdtest/Ordered_and_unordered_lists.text b/t/Markdown-from-MDTest1.1.mdtest/Ordered_and_unordered_lists.text new file mode 100644 index 0000000..7f3b497 --- /dev/null +++ b/t/Markdown-from-MDTest1.1.mdtest/Ordered_and_unordered_lists.text @@ -0,0 +1,131 @@ +## Unordered + +Asterisks tight: + +* asterisk 1 +* asterisk 2 +* asterisk 3 + + +Asterisks loose: + +* asterisk 1 + +* asterisk 2 + +* asterisk 3 + +* * * + +Pluses tight: + ++ Plus 1 ++ Plus 2 ++ Plus 3 + + +Pluses loose: + ++ Plus 1 + ++ Plus 2 + ++ Plus 3 + +* * * + + +Minuses tight: + +- Minus 1 +- Minus 2 +- Minus 3 + + +Minuses loose: + +- Minus 1 + +- Minus 2 + +- Minus 3 + + +## Ordered + +Tight: + +1. First +2. Second +3. Third + +and: + +1. One +2. Two +3. Three + + +Loose using tabs: + +1. First + +2. Second + +3. Third + +and using spaces: + +1. One + +2. Two + +3. Three + +Multiple paragraphs: + +1. Item 1, graf one. + + Item 2. graf two. The quick brown fox jumped over the lazy dog's + back. + +2. Item 2. + +3. Item 3. + + + +## Nested + +* Tab + * Tab + * Tab + +Here's another: + +1. First +2. Second: + * Fee + * Fie + * Foe +3. Third + +Same thing but with paragraphs: + +1. First + +2. Second: + * Fee + * Fie + * Foe + +3. Third + + +This was an error in Markdown 1.0.1: + +* this + + * sub + + that diff --git a/t/Markdown-from-MDTest1.1.mdtest/Ordered_and_unordered_lists.xhtml b/t/Markdown-from-MDTest1.1.mdtest/Ordered_and_unordered_lists.xhtml new file mode 100644 index 0000000..ba71eab --- /dev/null +++ b/t/Markdown-from-MDTest1.1.mdtest/Ordered_and_unordered_lists.xhtml @@ -0,0 +1,148 @@ +<h2>Unordered</h2> + +<p>Asterisks tight:</p> + +<ul> +<li>asterisk 1</li> +<li>asterisk 2</li> +<li>asterisk 3</li> +</ul> + +<p>Asterisks loose:</p> + +<ul> +<li><p>asterisk 1</p></li> +<li><p>asterisk 2</p></li> +<li><p>asterisk 3</p></li> +</ul> + +<hr /> + +<p>Pluses tight:</p> + +<ul> +<li>Plus 1</li> +<li>Plus 2</li> +<li>Plus 3</li> +</ul> + +<p>Pluses loose:</p> + +<ul> +<li><p>Plus 1</p></li> +<li><p>Plus 2</p></li> +<li><p>Plus 3</p></li> +</ul> + +<hr /> + +<p>Minuses tight:</p> + +<ul> +<li>Minus 1</li> +<li>Minus 2</li> +<li>Minus 3</li> +</ul> + +<p>Minuses loose:</p> + +<ul> +<li><p>Minus 1</p></li> +<li><p>Minus 2</p></li> +<li><p>Minus 3</p></li> +</ul> + +<h2>Ordered</h2> + +<p>Tight:</p> + +<ol> +<li>First</li> +<li>Second</li> +<li>Third</li> +</ol> + +<p>and:</p> + +<ol> +<li>One</li> +<li>Two</li> +<li>Three</li> +</ol> + +<p>Loose using tabs:</p> + +<ol> +<li><p>First</p></li> +<li><p>Second</p></li> +<li><p>Third</p></li> +</ol> + +<p>and using spaces:</p> + +<ol> +<li><p>One</p></li> +<li><p>Two</p></li> +<li><p>Three</p></li> +</ol> + +<p>Multiple paragraphs:</p> + +<ol> +<li><p>Item 1, graf one.</p> + +<p>Item 2. graf two. The quick brown fox jumped over the lazy dog's +back.</p></li> +<li><p>Item 2.</p></li> +<li><p>Item 3.</p></li> +</ol> + +<h2>Nested</h2> + +<ul> +<li>Tab +<ul> +<li>Tab +<ul> +<li>Tab</li> +</ul></li> +</ul></li> +</ul> + +<p>Here's another:</p> + +<ol> +<li>First</li> +<li>Second: +<ul> +<li>Fee</li> +<li>Fie</li> +<li>Foe</li> +</ul></li> +<li>Third</li> +</ol> + +<p>Same thing but with paragraphs:</p> + +<ol> +<li><p>First</p></li> +<li><p>Second:</p> + +<ul> +<li>Fee</li> +<li>Fie</li> +<li>Foe</li> +</ul></li> +<li><p>Third</p></li> +</ol> + + +<p>This was an error in Markdown 1.0.1:</p> + +<ul> +<li><p>this</p> + +<ul><li>sub</li></ul> + +<p>that</p></li> +</ul> diff --git a/t/Markdown-from-MDTest1.1.mdtest/Strong_and_em_together.text b/t/Markdown-from-MDTest1.1.mdtest/Strong_and_em_together.text new file mode 100644 index 0000000..95ee690 --- /dev/null +++ b/t/Markdown-from-MDTest1.1.mdtest/Strong_and_em_together.text @@ -0,0 +1,7 @@ +***This is strong and em.*** + +So is ***this*** word. + +___This is strong and em.___ + +So is ___this___ word. diff --git a/t/Markdown-from-MDTest1.1.mdtest/Strong_and_em_together.xhtml b/t/Markdown-from-MDTest1.1.mdtest/Strong_and_em_together.xhtml new file mode 100644 index 0000000..71ec78c --- /dev/null +++ b/t/Markdown-from-MDTest1.1.mdtest/Strong_and_em_together.xhtml @@ -0,0 +1,7 @@ +<p><strong><em>This is strong and em.</em></strong></p> + +<p>So is <strong><em>this</em></strong> word.</p> + +<p><strong><em>This is strong and em.</em></strong></p> + +<p>So is <strong><em>this</em></strong> word.</p> diff --git a/t/Markdown-from-MDTest1.1.mdtest/Tabs.text b/t/Markdown-from-MDTest1.1.mdtest/Tabs.text new file mode 100644 index 0000000..589d113 --- /dev/null +++ b/t/Markdown-from-MDTest1.1.mdtest/Tabs.text @@ -0,0 +1,21 @@ ++ this is a list item + indented with tabs + ++ this is a list item + indented with spaces + +Code: + + this code block is indented by one tab + +And: + + this code block is indented by two tabs + +And: + + + this is an example list item + indented with tabs + + + this is an example list item + indented with spaces diff --git a/t/Markdown-from-MDTest1.1.mdtest/Tabs.xhtml b/t/Markdown-from-MDTest1.1.mdtest/Tabs.xhtml new file mode 100644 index 0000000..3301ba8 --- /dev/null +++ b/t/Markdown-from-MDTest1.1.mdtest/Tabs.xhtml @@ -0,0 +1,25 @@ +<ul> +<li><p>this is a list item +indented with tabs</p></li> +<li><p>this is a list item +indented with spaces</p></li> +</ul> + +<p>Code:</p> + +<pre><code>this code block is indented by one tab +</code></pre> + +<p>And:</p> + +<pre><code> this code block is indented by two tabs +</code></pre> + +<p>And:</p> + +<pre><code>+ this is an example list item + indented with tabs + ++ this is an example list item + indented with spaces +</code></pre> diff --git a/t/Markdown-from-MDTest1.1.mdtest/Tidyness.text b/t/Markdown-from-MDTest1.1.mdtest/Tidyness.text new file mode 100644 index 0000000..5f18b8d --- /dev/null +++ b/t/Markdown-from-MDTest1.1.mdtest/Tidyness.text @@ -0,0 +1,5 @@ +> A list within a blockquote: +> +> * asterisk 1 +> * asterisk 2 +> * asterisk 3 diff --git a/t/Markdown-from-MDTest1.1.mdtest/Tidyness.xhtml b/t/Markdown-from-MDTest1.1.mdtest/Tidyness.xhtml new file mode 100644 index 0000000..f2a8ce7 --- /dev/null +++ b/t/Markdown-from-MDTest1.1.mdtest/Tidyness.xhtml @@ -0,0 +1,8 @@ +<blockquote> +<p>A list within a blockquote:</p> +<ul> +<li>asterisk 1</li> +<li>asterisk 2</li> +<li>asterisk 3</li> +</ul> +</blockquote> diff --git a/t/PHP_Markdown-from-MDTest1.1.mdtest/Backslash_escapes.text b/t/PHP_Markdown-from-MDTest1.1.mdtest/Backslash_escapes.text new file mode 100644 index 0000000..a5e769b --- /dev/null +++ b/t/PHP_Markdown-from-MDTest1.1.mdtest/Backslash_escapes.text @@ -0,0 +1 @@ +Tricky combinaisons:
backslash with \\-- two dashes
backslash with \\> greater than
\\\[test](not a link)
\\\*no emphasis*
\ No newline at end of file diff --git a/t/PHP_Markdown-from-MDTest1.1.mdtest/Backslash_escapes.xhtml b/t/PHP_Markdown-from-MDTest1.1.mdtest/Backslash_escapes.xhtml new file mode 100644 index 0000000..08fb8ef --- /dev/null +++ b/t/PHP_Markdown-from-MDTest1.1.mdtest/Backslash_escapes.xhtml @@ -0,0 +1 @@ +<p>Tricky combinaisons:</p>
<p>backslash with \-- two dashes</p>
<p>backslash with \> greater than</p>
<p>\[test](not a link)</p>
<p>\*no emphasis*</p>
\ No newline at end of file diff --git a/t/PHP_Markdown-from-MDTest1.1.mdtest/Code_Spans.text b/t/PHP_Markdown-from-MDTest1.1.mdtest/Code_Spans.text new file mode 100644 index 0000000..43f2bcf --- /dev/null +++ b/t/PHP_Markdown-from-MDTest1.1.mdtest/Code_Spans.text @@ -0,0 +1,6 @@ +From `<!--` to `-->` +on two lines. + +From `<!--` +to `-->` +on three lines. diff --git a/t/PHP_Markdown-from-MDTest1.1.mdtest/Code_Spans.xhtml b/t/PHP_Markdown-from-MDTest1.1.mdtest/Code_Spans.xhtml new file mode 100644 index 0000000..9ed0df8 --- /dev/null +++ b/t/PHP_Markdown-from-MDTest1.1.mdtest/Code_Spans.xhtml @@ -0,0 +1,6 @@ +<p>From <code><!--</code> to <code>--></code> +on two lines.</p> + +<p>From <code><!--</code> +to <code>--></code> +on three lines.</p> diff --git a/t/PHP_Markdown-from-MDTest1.1.mdtest/Code_block_in_a_list_item.text b/t/PHP_Markdown-from-MDTest1.1.mdtest/Code_block_in_a_list_item.text new file mode 100644 index 0000000..3fa24c3 --- /dev/null +++ b/t/PHP_Markdown-from-MDTest1.1.mdtest/Code_block_in_a_list_item.text @@ -0,0 +1,8 @@ + +* List Item: + + code block + + with a blank line + + within a list item.
\ No newline at end of file diff --git a/t/PHP_Markdown-from-MDTest1.1.mdtest/Code_block_in_a_list_item.xhtml b/t/PHP_Markdown-from-MDTest1.1.mdtest/Code_block_in_a_list_item.xhtml new file mode 100644 index 0000000..7d57b1e --- /dev/null +++ b/t/PHP_Markdown-from-MDTest1.1.mdtest/Code_block_in_a_list_item.xhtml @@ -0,0 +1,10 @@ +<ul> +<li><p>List Item:</p> + +<pre><code>code block + +with a blank line +</code></pre> + +<p>within a list item.</p></li> +</ul>
\ No newline at end of file diff --git a/t/PHP_Markdown-from-MDTest1.1.mdtest/Email_auto_links.text b/t/PHP_Markdown-from-MDTest1.1.mdtest/Email_auto_links.text new file mode 100644 index 0000000..a8af4ec --- /dev/null +++ b/t/PHP_Markdown-from-MDTest1.1.mdtest/Email_auto_links.text @@ -0,0 +1,3 @@ +<michel.fortin@michelf.com> + +International domain names: <help@tūdaliņ.lv>
\ No newline at end of file diff --git a/t/PHP_Markdown-from-MDTest1.1.mdtest/Email_auto_links.xhtml b/t/PHP_Markdown-from-MDTest1.1.mdtest/Email_auto_links.xhtml new file mode 100644 index 0000000..a32c408 --- /dev/null +++ b/t/PHP_Markdown-from-MDTest1.1.mdtest/Email_auto_links.xhtml @@ -0,0 +1,3 @@ +<p><a href="mailto:michel.fortin@michelf.com">michel.fortin@michelf.com</a></p> + +<p>International domain names: <a href="mailto:help@tūdaliņ.lv">help@tūdaliņ.lv</a></p> diff --git a/t/PHP_Markdown-from-MDTest1.1.mdtest/Emphasis.text b/t/PHP_Markdown-from-MDTest1.1.mdtest/Emphasis.text new file mode 100644 index 0000000..ec48dec --- /dev/null +++ b/t/PHP_Markdown-from-MDTest1.1.mdtest/Emphasis.text @@ -0,0 +1,69 @@ +Combined emphasis: + +1. ***test test*** +2. ___test test___ +3. *test **test*** +4. **test *test*** +5. ***test* test** +6. ***test** test* +7. ***test* test** +8. **test *test*** +9. *test **test*** +10. _test __test___ +11. __test _test___ +12. ___test_ test__ +13. ___test__ test_ +14. ___test_ test__ +15. __test _test___ +16. _test __test___ + + +Incorrect nesting: + +1. *test **test* test** +2. _test __test_ test__ +3. **test *test** test* +4. __test _test__ test_ +5. *test *test* test* +6. _test _test_ test_ +7. **test **test** test** +8. __test __test__ test__ + + + +No emphasis: + +1. test* test *test +2. test** test **test +3. test_ test _test +4. test__ test __test + + + +Middle-word emphasis (asterisks): + +1. *a*b +2. a*b* +3. a*b*c +4. **a**b +5. a**b** +6. a**b**c + + +Middle-word emphasis (underscore): + +1. _a_b +2. a_b_ +3. a_b_c +4. __a__b +5. a__b__ +6. a__b__c + +my_precious_file.txt + + +## Tricky Cases + +E**. **Test** TestTestTest + +E**. **Test** Test Test Test diff --git a/t/PHP_Markdown-from-MDTest1.1.mdtest/Emphasis.xhtml b/t/PHP_Markdown-from-MDTest1.1.mdtest/Emphasis.xhtml new file mode 100644 index 0000000..7399132 --- /dev/null +++ b/t/PHP_Markdown-from-MDTest1.1.mdtest/Emphasis.xhtml @@ -0,0 +1,72 @@ +<p>Combined emphasis:</p> + +<ol> +<li><strong><em>test test</em></strong></li> +<li><strong><em>test test</em></strong></li> +<li><em>test <strong>test</strong></em></li> +<li><strong>test <em>test</em></strong></li> +<li><strong><em>test</em> test</strong></li> +<li><em><strong>test</strong> test</em></li> +<li><strong><em>test</em> test</strong></li> +<li><strong>test <em>test</em></strong></li> +<li><em>test <strong>test</strong></em></li> +<li><em>test <strong>test</strong></em></li> +<li><strong>test <em>test</em></strong></li> +<li><strong><em>test</em> test</strong></li> +<li><em><strong>test</strong> test</em></li> +<li><strong><em>test</em> test</strong></li> +<li><strong>test <em>test</em></strong></li> +<li><em>test <strong>test</strong></em></li> +</ol> + +<p>Incorrect nesting:</p> + +<ol> +<li>*test <strong>test* test</strong></li> +<li>_test <strong>test_ test</strong></li> +<li>**test <em>test</em>* test*</li> +<li>__test <em>test</em>_ test_</li> +<li><em>test *test</em> test*</li> +<li><em>test _test</em> test_</li> +<li><strong>test <strong>test</strong> test</strong></li> +<li><strong>test <strong>test</strong> test</strong></li> +</ol> + +<p>No emphasis:</p> + +<ol> +<li>test* test *test</li> +<li>test** test **test</li> +<li>test_ test _test</li> +<li>test__ test __test</li> +</ol> + +<p>Middle-word emphasis (asterisks):</p> + +<ol> +<li><em>a</em>b</li> +<li>a<em>b</em></li> +<li>a<em>b</em>c</li> +<li><strong>a</strong>b</li> +<li>a<strong>b</strong></li> +<li>a<strong>b</strong>c</li> +</ol> + +<p>Middle-word emphasis (underscore):</p> + +<ol> +<li><em>a</em>b</li> +<li>a<em>b</em></li> +<li>a<em>b</em>c</li> +<li><strong>a</strong>b</li> +<li>a<strong>b</strong></li> +<li>a<strong>b</strong>c</li> +</ol> + +<p>my<em>precious</em>file.txt</p> + +<h2>Tricky Cases</h2> + +<p>E**. <strong>Test</strong> TestTestTest</p> + +<p>E**. <strong>Test</strong> Test Test Test</p> diff --git a/t/PHP_Markdown-from-MDTest1.1.mdtest/Headers.text b/t/PHP_Markdown-from-MDTest1.1.mdtest/Headers.text new file mode 100644 index 0000000..3a39174 --- /dev/null +++ b/t/PHP_Markdown-from-MDTest1.1.mdtest/Headers.text @@ -0,0 +1,9 @@ +Header
======
Header
------
### Header + + - - - + +Header
======
Paragraph
Header
------
Paragraph
### Header
Paragraph + + - - - + +Paragraph
Header
======
Paragraph
Paragraph
Header
------
Paragraph
Paragraph
### Header
Paragraph
\ No newline at end of file diff --git a/t/PHP_Markdown-from-MDTest1.1.mdtest/Headers.xhtml b/t/PHP_Markdown-from-MDTest1.1.mdtest/Headers.xhtml new file mode 100644 index 0000000..3adb470 --- /dev/null +++ b/t/PHP_Markdown-from-MDTest1.1.mdtest/Headers.xhtml @@ -0,0 +1,39 @@ +<h1>Header</h1> + +<h2>Header</h2> + +<h3>Header</h3> + +<hr /> + +<h1>Header</h1> + +<p>Paragraph</p> + +<h2>Header</h2> + +<p>Paragraph</p> + +<h3>Header</h3> + +<p>Paragraph</p> + +<hr /> + +<p>Paragraph</p> + +<h1>Header</h1> + +<p>Paragraph</p> + +<p>Paragraph</p> + +<h2>Header</h2> + +<p>Paragraph</p> + +<p>Paragraph</p> + +<h3>Header</h3> + +<p>Paragraph</p> diff --git a/t/PHP_Markdown-from-MDTest1.1.mdtest/Horizontal_Rules.text b/t/PHP_Markdown-from-MDTest1.1.mdtest/Horizontal_Rules.text new file mode 100644 index 0000000..8e2da0b --- /dev/null +++ b/t/PHP_Markdown-from-MDTest1.1.mdtest/Horizontal_Rules.text @@ -0,0 +1,29 @@ +Horizontal rules: + +- - - + +* * * + +*** + +--- + +___ + +Not horizontal rules (testing for a bug in 1.0.1j): + ++++ + +,,, + +=== + +??? + +AAA + +jjj + +j j j + +n n n diff --git a/t/PHP_Markdown-from-MDTest1.1.mdtest/Horizontal_Rules.xhtml b/t/PHP_Markdown-from-MDTest1.1.mdtest/Horizontal_Rules.xhtml new file mode 100644 index 0000000..b9170b1 --- /dev/null +++ b/t/PHP_Markdown-from-MDTest1.1.mdtest/Horizontal_Rules.xhtml @@ -0,0 +1,30 @@ +<p>Horizontal rules:</p> + +<hr /> + +<hr /> + +<hr /> + +<hr /> + +<hr /> + +<p>Not horizontal rules (testing for a bug in 1.0.1j):</p> + +<p>+++</p> + +<p>,,,</p> + +<p>===</p> + +<p>???</p> + +<p>AAA</p> + +<p>jjj</p> + +<p>j j j</p> + +<p>n n n</p> + diff --git a/t/PHP_Markdown-from-MDTest1.1.mdtest/Inline_HTML_(Simple).html b/t/PHP_Markdown-from-MDTest1.1.mdtest/Inline_HTML_(Simple).html new file mode 100644 index 0000000..facfefb --- /dev/null +++ b/t/PHP_Markdown-from-MDTest1.1.mdtest/Inline_HTML_(Simple).html @@ -0,0 +1,15 @@ +<p>With some attributes:</p> + +<div id="test"> + foo +</div> + +<div id="test" + class="nono"> + foo +</div> + +<p>Hr's:</p> + +<hr class="foo" + id="bar" >
\ No newline at end of file diff --git a/t/PHP_Markdown-from-MDTest1.1.mdtest/Inline_HTML_(Simple).text b/t/PHP_Markdown-from-MDTest1.1.mdtest/Inline_HTML_(Simple).text new file mode 100644 index 0000000..9177105 --- /dev/null +++ b/t/PHP_Markdown-from-MDTest1.1.mdtest/Inline_HTML_(Simple).text @@ -0,0 +1,15 @@ +With some attributes: + +<div id="test"> + foo +</div> + +<div id="test" + class="nono"> + foo +</div> + +Hr's: + +<hr class="foo" + id="bar" > diff --git a/t/PHP_Markdown-from-MDTest1.1.mdtest/Inline_HTML_(Span).text b/t/PHP_Markdown-from-MDTest1.1.mdtest/Inline_HTML_(Span).text new file mode 100644 index 0000000..19028bb --- /dev/null +++ b/t/PHP_Markdown-from-MDTest1.1.mdtest/Inline_HTML_(Span).text @@ -0,0 +1,4 @@ +<abbr title="` **Attribute Content Is Not A Code Span** `">ACINACS</abbr> + +<abbr title="`first backtick!">SB</abbr> +<abbr title="`second backtick!">SB</abbr>
\ No newline at end of file diff --git a/t/PHP_Markdown-from-MDTest1.1.mdtest/Inline_HTML_(Span).xhtml b/t/PHP_Markdown-from-MDTest1.1.mdtest/Inline_HTML_(Span).xhtml new file mode 100644 index 0000000..4d18aff --- /dev/null +++ b/t/PHP_Markdown-from-MDTest1.1.mdtest/Inline_HTML_(Span).xhtml @@ -0,0 +1,4 @@ +<p><abbr title="` **Attribute Content Is Not A Code Span** `">ACINACS</abbr></p> + +<p><abbr title="`first backtick!">SB</abbr> +<abbr title="`second backtick!">SB</abbr></p>
\ No newline at end of file diff --git a/t/PHP_Markdown-from-MDTest1.1.mdtest/Inline_HTML_comments.html b/t/PHP_Markdown-from-MDTest1.1.mdtest/Inline_HTML_comments.html new file mode 100644 index 0000000..b45f014 --- /dev/null +++ b/t/PHP_Markdown-from-MDTest1.1.mdtest/Inline_HTML_comments.html @@ -0,0 +1,9 @@ +<p>Paragraph one.</p> + +<!-- double--dash (invalid SGML comment) --> + +<p>Paragraph two.</p> + +<!-- enclosed tag </div> --> + +<p>The end.</p> diff --git a/t/PHP_Markdown-from-MDTest1.1.mdtest/Inline_HTML_comments.text b/t/PHP_Markdown-from-MDTest1.1.mdtest/Inline_HTML_comments.text new file mode 100644 index 0000000..d57d00a --- /dev/null +++ b/t/PHP_Markdown-from-MDTest1.1.mdtest/Inline_HTML_comments.text @@ -0,0 +1,9 @@ +Paragraph one. + +<!-- double--dash (invalid SGML comment) --> + +Paragraph two. + +<!-- enclosed tag </div> --> + +The end. diff --git a/t/PHP_Markdown-from-MDTest1.1.mdtest/Ins_and_del.text b/t/PHP_Markdown-from-MDTest1.1.mdtest/Ins_and_del.text new file mode 100644 index 0000000..2d54c66 --- /dev/null +++ b/t/PHP_Markdown-from-MDTest1.1.mdtest/Ins_and_del.text @@ -0,0 +1,17 @@ +Here is a block tag ins: + +<ins> +<p>Some text</p> +</ins> + +<ins>And here it is inside a paragraph.</ins> + +And here it is <ins>in the middle of</ins> a paragraph. + +<del> +<p>Some text</p> +</del> + +<del>And here is ins as a paragraph.</del> + +And here it is <del>in the middle of</del> a paragraph. diff --git a/t/PHP_Markdown-from-MDTest1.1.mdtest/Ins_and_del.xhtml b/t/PHP_Markdown-from-MDTest1.1.mdtest/Ins_and_del.xhtml new file mode 100644 index 0000000..60e8c5f --- /dev/null +++ b/t/PHP_Markdown-from-MDTest1.1.mdtest/Ins_and_del.xhtml @@ -0,0 +1,17 @@ +<p>Here is a block tag ins:</p> + +<ins> +<p>Some text</p> +</ins> + +<p><ins>And here it is inside a paragraph.</ins></p> + +<p>And here it is <ins>in the middle of</ins> a paragraph.</p> + +<del> +<p>Some text</p> +</del> + +<p><del>And here is ins as a paragraph.</del></p> + +<p>And here it is <del>in the middle of</del> a paragraph.</p> diff --git a/t/PHP_Markdown-from-MDTest1.1.mdtest/Links_inline_style.text b/t/PHP_Markdown-from-MDTest1.1.mdtest/Links_inline_style.text new file mode 100644 index 0000000..600a044 --- /dev/null +++ b/t/PHP_Markdown-from-MDTest1.1.mdtest/Links_inline_style.text @@ -0,0 +1 @@ +[silly URL w/ angle brackets](<?}]*+|&)>). diff --git a/t/PHP_Markdown-from-MDTest1.1.mdtest/Links_inline_style.xhtml b/t/PHP_Markdown-from-MDTest1.1.mdtest/Links_inline_style.xhtml new file mode 100644 index 0000000..d3e4d11 --- /dev/null +++ b/t/PHP_Markdown-from-MDTest1.1.mdtest/Links_inline_style.xhtml @@ -0,0 +1 @@ +<p><a href="?}]*+|&)">silly URL w/ angle brackets</a>.</p> diff --git a/t/PHP_Markdown-from-MDTest1.1.mdtest/MD5_Hashes.text b/t/PHP_Markdown-from-MDTest1.1.mdtest/MD5_Hashes.text new file mode 100644 index 0000000..7e03221 --- /dev/null +++ b/t/PHP_Markdown-from-MDTest1.1.mdtest/MD5_Hashes.text @@ -0,0 +1,11 @@ +# Character Escapes + +The MD5 value for `+` is "26b17225b626fb9238849fd60eabdf60". + +# HTML Blocks + +<p>test</p> + +The MD5 value for `<p>test</p>` is: + +6205333b793f34273d75379350b36826
\ No newline at end of file diff --git a/t/PHP_Markdown-from-MDTest1.1.mdtest/MD5_Hashes.xhtml b/t/PHP_Markdown-from-MDTest1.1.mdtest/MD5_Hashes.xhtml new file mode 100644 index 0000000..894e4aa --- /dev/null +++ b/t/PHP_Markdown-from-MDTest1.1.mdtest/MD5_Hashes.xhtml @@ -0,0 +1,11 @@ +<h1>Character Escapes</h1> + +<p>The MD5 value for <code>+</code> is "26b17225b626fb9238849fd60eabdf60".</p> + +<h1>HTML Blocks</h1> + +<p>test</p> + +<p>The MD5 value for <code><p>test</p></code> is:</p> + +<p>6205333b793f34273d75379350b36826</p> diff --git a/t/PHP_Markdown-from-MDTest1.1.mdtest/Nesting.text b/t/PHP_Markdown-from-MDTest1.1.mdtest/Nesting.text new file mode 100644 index 0000000..791538c --- /dev/null +++ b/t/PHP_Markdown-from-MDTest1.1.mdtest/Nesting.text @@ -0,0 +1,11 @@ +Valid nesting: + +**[Link](url)** + +[**Link**](url) + +**[**Link**](url)** + +Invalid nesting: + +[[Link](url)](url)
\ No newline at end of file diff --git a/t/PHP_Markdown-from-MDTest1.1.mdtest/Nesting.xhtml b/t/PHP_Markdown-from-MDTest1.1.mdtest/Nesting.xhtml new file mode 100644 index 0000000..37845d3 --- /dev/null +++ b/t/PHP_Markdown-from-MDTest1.1.mdtest/Nesting.xhtml @@ -0,0 +1,11 @@ +<p>Valid nesting:</p> + +<p><strong><a href="url">Link</a></strong></p> + +<p><a href="url"><strong>Link</strong></a></p> + +<p><strong><a href="url"><strong>Link</strong></a></strong></p> + +<p>Invalid nesting:</p> + +<p><a href="url">[Link](url)</a></p> diff --git a/t/PHP_Markdown-from-MDTest1.1.mdtest/PHP-Specific_Bugs.text b/t/PHP_Markdown-from-MDTest1.1.mdtest/PHP-Specific_Bugs.text new file mode 100644 index 0000000..246b60d --- /dev/null +++ b/t/PHP_Markdown-from-MDTest1.1.mdtest/PHP-Specific_Bugs.text @@ -0,0 +1,22 @@ +This tests for a bug where quotes escaped by PHP when using +`preg_replace` with the `/e` modifier must be correctly unescaped +(hence the `_UnslashQuotes` function found only in PHP Markdown). + + + +Headers below should appear exactly as they are typed (no backslash +added or removed). + +Header "quoted\" again \\"" +=========================== + +Header "quoted\" again \\"" +--------------------------- + +### Header "quoted\" again \\"" ### + + + +Test with tabs for `_Detab`: + + Code 'block' with some "tabs" and "quotes" diff --git a/t/PHP_Markdown-from-MDTest1.1.mdtest/PHP-Specific_Bugs.xhtml b/t/PHP_Markdown-from-MDTest1.1.mdtest/PHP-Specific_Bugs.xhtml new file mode 100644 index 0000000..c982417 --- /dev/null +++ b/t/PHP_Markdown-from-MDTest1.1.mdtest/PHP-Specific_Bugs.xhtml @@ -0,0 +1,17 @@ +<p>This tests for a bug where quotes escaped by PHP when using +<code>preg_replace</code> with the <code>/e</code> modifier must be correctly unescaped +(hence the <code>_UnslashQuotes</code> function found only in PHP Markdown).</p> + +<p>Headers below should appear exactly as they are typed (no backslash +added or removed).</p> + +<h1>Header "quoted\" again \""</h1> + +<h2>Header "quoted\" again \""</h2> + +<h3>Header "quoted\" again \""</h3> + +<p>Test with tabs for <code>_Detab</code>:</p> + +<pre><code>Code 'block' with some "tabs" and "quotes" +</code></pre> diff --git a/t/PHP_Markdown-from-MDTest1.1.mdtest/Parens_in_URL.text b/t/PHP_Markdown-from-MDTest1.1.mdtest/Parens_in_URL.text new file mode 100644 index 0000000..bb7be4f --- /dev/null +++ b/t/PHP_Markdown-from-MDTest1.1.mdtest/Parens_in_URL.text @@ -0,0 +1,14 @@ +[Inline link 1 with parens](/url\(test\) "title"). + +[Inline link 2 with parens](</url\(test\)> "title"). + +[Inline link 3 with non-escaped parens](/url(test) "title"). + +[Inline link 4 with non-escaped parens](</url(test)> "title"). + +[Reference link 1 with parens][1]. + +[Reference link 2 with parens][2]. + + [1]: /url(test) "title" + [2]: </url(test)> "title" diff --git a/t/PHP_Markdown-from-MDTest1.1.mdtest/Parens_in_URL.xhtml b/t/PHP_Markdown-from-MDTest1.1.mdtest/Parens_in_URL.xhtml new file mode 100644 index 0000000..a81aa02 --- /dev/null +++ b/t/PHP_Markdown-from-MDTest1.1.mdtest/Parens_in_URL.xhtml @@ -0,0 +1,11 @@ +<p><a href="/url(test)" title="title">Inline link 1 with parens</a>.</p> + +<p><a href="/url(test)" title="title">Inline link 2 with parens</a>.</p> + +<p><a href="/url(test)" title="title">Inline link 3 with non-escaped parens</a>.</p> + +<p><a href="/url(test)" title="title">Inline link 4 with non-escaped parens</a>.</p> + +<p><a href="/url(test)" title="title">Reference link 1 with parens</a>.</p> + +<p><a href="/url(test)" title="title">Reference link 2 with parens</a>.</p>
\ No newline at end of file diff --git a/t/PHP_Markdown-from-MDTest1.1.mdtest/Tight_blocks.text b/t/PHP_Markdown-from-MDTest1.1.mdtest/Tight_blocks.text new file mode 100644 index 0000000..ae4cdcb --- /dev/null +++ b/t/PHP_Markdown-from-MDTest1.1.mdtest/Tight_blocks.text @@ -0,0 +1 @@ +Paragraph and no space:
* ciao
Paragraph and 1 space:
* ciao
Paragraph and 3 spaces:
* ciao
Paragraph and 4 spaces:
* ciao
Paragraph before header:
#Header
Paragraph before blockquote:
>Some quote.
\ No newline at end of file diff --git a/t/PHP_Markdown-from-MDTest1.1.mdtest/Tight_blocks.xhtml b/t/PHP_Markdown-from-MDTest1.1.mdtest/Tight_blocks.xhtml new file mode 100644 index 0000000..8655430 --- /dev/null +++ b/t/PHP_Markdown-from-MDTest1.1.mdtest/Tight_blocks.xhtml @@ -0,0 +1,21 @@ +<p>Paragraph and no space: +* ciao</p> + +<p>Paragraph and 1 space: + * ciao</p> + +<p>Paragraph and 3 spaces: + * ciao</p> + +<p>Paragraph and 4 spaces: + * ciao</p> + +<p>Paragraph before header:</p> + +<h1>Header</h1> + +<p>Paragraph before blockquote:</p> + +<blockquote> + <p>Some quote.</p> +</blockquote> diff --git a/t/Text-Markdown.mdtest/CoreDumps5.8.text b/t/Text-Markdown.mdtest/CoreDumps5.8.text new file mode 100644 index 0000000..30ce312 --- /dev/null +++ b/t/Text-Markdown.mdtest/CoreDumps5.8.text @@ -0,0 +1,7 @@ +* Unordered +1. Ordered + +Text + +* Unordered +1. Ordered diff --git a/t/Text-Markdown.mdtest/CoreDumps5.8.xhtml b/t/Text-Markdown.mdtest/CoreDumps5.8.xhtml new file mode 100644 index 0000000..8a2963e --- /dev/null +++ b/t/Text-Markdown.mdtest/CoreDumps5.8.xhtml @@ -0,0 +1,15 @@ +<ul> +<li>Unordered +<ol> +<li>Ordered</li> +</ol></li> +</ul> + +<p>Text</p> + +<ul> +<li>Unordered +<ol> +<li>Ordered</li> +</ol></li> +</ul> diff --git a/t/Text-Markdown.mdtest/Emphasis.text b/t/Text-Markdown.mdtest/Emphasis.text new file mode 100644 index 0000000..104f90e --- /dev/null +++ b/t/Text-Markdown.mdtest/Emphasis.text @@ -0,0 +1,4 @@ +_M*A*S*H_ here I am going with original Markdown.. + +foo_bar_bas I am going with PHP Markdown Extra here (by default, there is an option for original style behavior - see +docs).. diff --git a/t/Text-Markdown.mdtest/Emphasis.xhtml b/t/Text-Markdown.mdtest/Emphasis.xhtml new file mode 100644 index 0000000..96cef6d --- /dev/null +++ b/t/Text-Markdown.mdtest/Emphasis.xhtml @@ -0,0 +1,4 @@ +<p><em>M*A*S*H</em> here I am going with original Markdown..</p> + +<p>foo_bar_bas I am going with PHP Markdown Extra here (by default, there is an option for original style behavior - see +docs)..</p> diff --git a/t/Text-Markdown.mdtest/HTML-Comment-encoding.text b/t/Text-Markdown.mdtest/HTML-Comment-encoding.text new file mode 100644 index 0000000..557c6af --- /dev/null +++ b/t/Text-Markdown.mdtest/HTML-Comment-encoding.text @@ -0,0 +1,5 @@ +A markdown paragraph with a comment that *will* be processed by original Markdown. However MultiMarkdown and Pandoc do not convert the & sigil in the comment.. + +A paragraph <!-- This & *will* be converted by original Markdown --> + +<p><!-- This & will *not* be converted --></p> diff --git a/t/Text-Markdown.mdtest/HTML-Comment-encoding.xhtml b/t/Text-Markdown.mdtest/HTML-Comment-encoding.xhtml new file mode 100644 index 0000000..b19577f --- /dev/null +++ b/t/Text-Markdown.mdtest/HTML-Comment-encoding.xhtml @@ -0,0 +1,5 @@ +<p>A markdown paragraph with a comment that <em>will</em> be processed by original Markdown. However MultiMarkdown and Pandoc do not convert the & sigil in the comment.. </p> + +<p>A paragraph <!-- This & *will* be converted by original Markdown --></p> + +<p><!-- This & will *not* be converted --></p> diff --git a/t/Text-Markdown.mdtest/HTML5-attributes.html b/t/Text-Markdown.mdtest/HTML5-attributes.html new file mode 100644 index 0000000..9dc2b47 --- /dev/null +++ b/t/Text-Markdown.mdtest/HTML5-attributes.html @@ -0,0 +1,11 @@ +<h1 class=foo>foo</h1> + +<p class=bar> +this is a paragraph +</p> + +<h2 class=bar> +an h2 +</h2> + +<p>normal</p> diff --git a/t/Text-Markdown.mdtest/HTML5-attributes.text b/t/Text-Markdown.mdtest/HTML5-attributes.text new file mode 100644 index 0000000..66d655a --- /dev/null +++ b/t/Text-Markdown.mdtest/HTML5-attributes.text @@ -0,0 +1,11 @@ +<h1 class=foo>foo</h1> + +<p class=bar> +this is a paragraph +</p> + +<h2 class=bar> +an h2 +</h2> + +normal diff --git a/t/Text-Markdown.mdtest/Links_brackets.text b/t/Text-Markdown.mdtest/Links_brackets.text new file mode 100644 index 0000000..6dd3c5d --- /dev/null +++ b/t/Text-Markdown.mdtest/Links_brackets.text @@ -0,0 +1,2 @@ +[ZIP archives](http://en.wikipedia.org/wiki/ZIP_(file_format) "ZIP (file format) - Wikipedia, the free encyclopedia") + diff --git a/t/Text-Markdown.mdtest/Links_brackets.xhtml b/t/Text-Markdown.mdtest/Links_brackets.xhtml new file mode 100644 index 0000000..75376b9 --- /dev/null +++ b/t/Text-Markdown.mdtest/Links_brackets.xhtml @@ -0,0 +1 @@ +<p><a href="http://en.wikipedia.org/wiki/ZIP_(file_format)" title="ZIP (file format) - Wikipedia, the free encyclopedia">ZIP archives</a></p> diff --git a/t/Text-Markdown.mdtest/Links_multiline_bugs_1.html b/t/Text-Markdown.mdtest/Links_multiline_bugs_1.html new file mode 100644 index 0000000..386174a --- /dev/null +++ b/t/Text-Markdown.mdtest/Links_multiline_bugs_1.html @@ -0,0 +1,4 @@ +<p><a href="http://bugs.debian.org/459885">http://bugs.debian.org/459885</a></p> + +<p><a href="/someurl/">link +text</a></p> diff --git a/t/Text-Markdown.mdtest/Links_multiline_bugs_1.text b/t/Text-Markdown.mdtest/Links_multiline_bugs_1.text new file mode 100644 index 0000000..9744d4f --- /dev/null +++ b/t/Text-Markdown.mdtest/Links_multiline_bugs_1.text @@ -0,0 +1,7 @@ +<http://bugs.debian.org/459885> + +[link +text] [link +id] + +[link id]: /someurl/ diff --git a/t/Text-Markdown.mdtest/Links_multiline_bugs_2.html b/t/Text-Markdown.mdtest/Links_multiline_bugs_2.html new file mode 100644 index 0000000..7be828b --- /dev/null +++ b/t/Text-Markdown.mdtest/Links_multiline_bugs_2.html @@ -0,0 +1,4 @@ +<p><a href="http://bugs.debian.org/459885">http://bugs.debian.org/459885</a></p> + +<p>Bla, bla, bla, bla, bla, bla, bla, bla, bla, bla bla. This is <a href="http://www.ua.es">my <br /> +University</a>.</p> diff --git a/t/Text-Markdown.mdtest/Links_multiline_bugs_2.text b/t/Text-Markdown.mdtest/Links_multiline_bugs_2.text new file mode 100644 index 0000000..773679e --- /dev/null +++ b/t/Text-Markdown.mdtest/Links_multiline_bugs_2.text @@ -0,0 +1,6 @@ +<http://bugs.debian.org/459885> + +Bla, bla, bla, bla, bla, bla, bla, bla, bla, bla bla. This is [my +University][]. + + [my university]: http://www.ua.es diff --git a/t/Text-Markdown.mdtest/Links_reference_style.text b/t/Text-Markdown.mdtest/Links_reference_style.text new file mode 100644 index 0000000..8b1aaf9 --- /dev/null +++ b/t/Text-Markdown.mdtest/Links_reference_style.text @@ -0,0 +1,87 @@ +Foo [bar] [1]. + +Foo [bar][1]. + +Foo [bar] +[1]. + +[1]: /url/ "Title" + + +With [embedded [brackets]] [b]. + + +Indented [once][]. + +Indented [twice][]. + +Indented [thrice][]. + +Indented [four][] times. + + [once]: /url + + [twice]: /url + + [thrice]: /url + + [four]: /url + + +[b]: /url/ + +* * * + +[this] [this] should work + +So should [this][this]. + +And [this] []. + +And [this][]. + +And [this]. + +But not [that] []. + +Nor [that][]. + +Nor [that]. + +[Something in brackets like [this][] should work] + +[Same with [this].] + +In this case, [this](/somethingelse/) points to something else. + +Backslashing should suppress \[this] and [this\]. + +[this]: foo + + +* * * + +Here's one where the [link +breaks] across lines. + +Here's another where the [link +breaks] across lines, but with a line-ending space. + + +[link breaks]: /url/ + +More multi line edge cases. First a broken link id + +[link +text] [link +id] + +[link id]: /someurl/ + +Then a line with 2 chars of trailing whitespace and a line break [my +University][]. + +The a shortcut reference link with 2 chars of trailing whitespace and a line break [my +University]. + + [my university]: http://www.ua.es
\ No newline at end of file diff --git a/t/Text-Markdown.mdtest/Links_reference_style.xhtml b/t/Text-Markdown.mdtest/Links_reference_style.xhtml new file mode 100644 index 0000000..0793721 --- /dev/null +++ b/t/Text-Markdown.mdtest/Links_reference_style.xhtml @@ -0,0 +1,63 @@ +<p>Foo <a href="/url/" title="Title">bar</a>.</p> + +<p>Foo <a href="/url/" title="Title">bar</a>.</p> + +<p>Foo <a href="/url/" title="Title">bar</a>.</p> + +<p>With <a href="/url/">embedded [brackets]</a>.</p> + +<p>Indented <a href="/url">once</a>.</p> + +<p>Indented <a href="/url">twice</a>.</p> + +<p>Indented <a href="/url">thrice</a>.</p> + +<p>Indented [four][] times.</p> + +<pre><code>[four]: /url +</code></pre> + +<hr /> + +<p><a href="foo">this</a> should work</p> + +<p>So should <a href="foo">this</a>.</p> + +<p>And <a href="foo">this</a>.</p> + +<p>And <a href="foo">this</a>.</p> + +<p>And <a href="foo">this</a>.</p> + +<p>But not [that] [].</p> + +<p>Nor [that][].</p> + +<p>Nor [that].</p> + +<p>[Something in brackets like <a href="foo">this</a> should work]</p> + +<p>[Same with <a href="foo">this</a>.]</p> + +<p>In this case, <a href="/somethingelse/">this</a> points to something else.</p> + +<p>Backslashing should suppress [this] and [this].</p> + +<hr /> + +<p>Here's one where the <a href="/url/">link +breaks</a> across lines.</p> + +<p>Here's another where the <a href="/url/">link +breaks</a> across lines, but with a line-ending space.</p> + +<p>More multi line edge cases. First a broken link id</p> + +<p><a href="/someurl/">link +text</a></p> + +<p>Then a line with 2 chars of trailing whitespace and a line break <a href="http://www.ua.es">my <br /> +University</a>.</p> + +<p>The a shortcut reference link with 2 chars of trailing whitespace and a line break <a href="http://www.ua.es">my <br /> +University</a>.</p> diff --git a/t/Text-Markdown.mdtest/Lists-multilevel-md5-edgecase.text b/t/Text-Markdown.mdtest/Lists-multilevel-md5-edgecase.text new file mode 100644 index 0000000..6bd63e8 --- /dev/null +++ b/t/Text-Markdown.mdtest/Lists-multilevel-md5-edgecase.text @@ -0,0 +1,25 @@ +# text1 + + * text2 + + * text3 + + text4 + +## text5 + + * text6 + + * text7 + + text8 + +## text9 + + * text10 + + * text11 + + text12 + + text13 diff --git a/t/Text-Markdown.mdtest/Lists-multilevel-md5-edgecase.xhtml b/t/Text-Markdown.mdtest/Lists-multilevel-md5-edgecase.xhtml new file mode 100644 index 0000000..9c7617c --- /dev/null +++ b/t/Text-Markdown.mdtest/Lists-multilevel-md5-edgecase.xhtml @@ -0,0 +1,37 @@ +<h1>text1</h1> + +<ul> +<li><p>text2</p> + +<ul> +<li>text3</li> +</ul> + +<p>text4</p></li> +</ul> + +<h2>text5</h2> + +<ul> +<li><p>text6</p> + +<ul> +<li>text7</li> +</ul> + +<p>text8</p></li> +</ul> + +<h2>text9</h2> + +<ul> +<li><p>text10</p> + +<ul> +<li>text11</li> +</ul> + +<p>text12</p> + +<p>text13</p></li> +</ul> diff --git a/t/Text-Markdown.mdtest/PHP-ASP_tags.text b/t/Text-Markdown.mdtest/PHP-ASP_tags.text new file mode 100644 index 0000000..6cd1887 --- /dev/null +++ b/t/Text-Markdown.mdtest/PHP-ASP_tags.text @@ -0,0 +1,7 @@ +I am going with the same as Markdown.pl 1.0.2b8 here. *However* I reserve the right to also leave Template toolkit alone at a later date if I need to.. + +<%foo ok %> + +<?php test_foo ?> + +[% template_toolkit %]
\ No newline at end of file diff --git a/t/Text-Markdown.mdtest/PHP-ASP_tags.xhtml b/t/Text-Markdown.mdtest/PHP-ASP_tags.xhtml new file mode 100644 index 0000000..96eb227 --- /dev/null +++ b/t/Text-Markdown.mdtest/PHP-ASP_tags.xhtml @@ -0,0 +1,7 @@ +<p>I am going with the same as Markdown.pl 1.0.2b8 here. <em>However</em> I reserve the right to also leave Template toolkit alone at a later date if I need to..</p> + +<%foo ok %> + +<?php test_foo ?> + +<p>[% template_toolkit %]</p> diff --git a/t/Text-Markdown.mdtest/Unicode.text b/t/Text-Markdown.mdtest/Unicode.text new file mode 100644 index 0000000..4b63bea --- /dev/null +++ b/t/Text-Markdown.mdtest/Unicode.text @@ -0,0 +1,5 @@ +> Fo—o + +μορεοϋερ + +> ßåř diff --git a/t/Text-Markdown.mdtest/Unicode.xhtml b/t/Text-Markdown.mdtest/Unicode.xhtml new file mode 100644 index 0000000..ca06ddd --- /dev/null +++ b/t/Text-Markdown.mdtest/Unicode.xhtml @@ -0,0 +1,9 @@ +<blockquote> + <p>Fo—o</p> +</blockquote> + +<p>μορεοϋερ</p> + +<blockquote> + <p>ßåř</p> +</blockquote> diff --git a/t/code-hr.t b/t/code-hr.t new file mode 100644 index 0000000..005b39a --- /dev/null +++ b/t/code-hr.t @@ -0,0 +1,16 @@ +use strict; +use warnings; +use Text::Markdown 'markdown'; +use Test::More tests => 1; + +my $txt = markdown(<<'END_MARKDOWN', { tab_width => 2 }); +This is a para. + + This is code. + --- + This is code. + +This is a para. +END_MARKDOWN + +unlike($txt, qr{<hr}, "no HR elements when the hr is in a code block"); diff --git a/t/docs-maruku-unittest/abbreviations.html b/t/docs-maruku-unittest/abbreviations.html new file mode 100644 index 0000000..b670785 --- /dev/null +++ b/t/docs-maruku-unittest/abbreviations.html @@ -0,0 +1,3 @@ +<p>The <abbr title='Hyper Text Markup Language'>HTML</abbr> specification is maintained by the <abbr title='World Wide Web Consortium'>W3C</abbr>.</p> + +<p>Operation <abbr>Tigra Genesis</abbr> is going well.</p> diff --git a/t/docs-maruku-unittest/abbreviations.text b/t/docs-maruku-unittest/abbreviations.text new file mode 100644 index 0000000..6551313 --- /dev/null +++ b/t/docs-maruku-unittest/abbreviations.text @@ -0,0 +1,11 @@ + +The HTML specification is maintained by the W3C. + +*[HTML]: Hyper Text Markup Language +*[W3C]: World Wide Web Consortium + + + +Operation Tigra Genesis is going well. + +*[Tigra Genesis]: diff --git a/t/docs-maruku-unittest/alt.html b/t/docs-maruku-unittest/alt.html new file mode 100644 index 0000000..d4f1d31 --- /dev/null +++ b/t/docs-maruku-unittest/alt.html @@ -0,0 +1 @@ +<p><img src='/foo.jpg' alt='bar' /></p> diff --git a/t/docs-maruku-unittest/alt.text b/t/docs-maruku-unittest/alt.text new file mode 100644 index 0000000..915c68f --- /dev/null +++ b/t/docs-maruku-unittest/alt.text @@ -0,0 +1,3 @@ +  + + diff --git a/t/docs-maruku-unittest/blank.html b/t/docs-maruku-unittest/blank.html new file mode 100644 index 0000000..f735d03 --- /dev/null +++ b/t/docs-maruku-unittest/blank.html @@ -0,0 +1,3 @@ +<p>Linea 1</p> + +<p>Linea 2</p> diff --git a/t/docs-maruku-unittest/blank.text b/t/docs-maruku-unittest/blank.text new file mode 100644 index 0000000..e065a12 --- /dev/null +++ b/t/docs-maruku-unittest/blank.text @@ -0,0 +1,4 @@ + +Linea 1 + +Linea 2 diff --git a/t/docs-maruku-unittest/blanks_in_code.html b/t/docs-maruku-unittest/blanks_in_code.html new file mode 100644 index 0000000..a4ef5db --- /dev/null +++ b/t/docs-maruku-unittest/blanks_in_code.html @@ -0,0 +1,16 @@ +<p>This block is composed of three lines:</p> + +<pre><code>one + +three</code></pre> + +<p>This block is composed of 5</p> + +<pre><code>one + + +four</code></pre> + +<p>This block is composed of 2</p> + +<pre><code>two</code></pre> diff --git a/t/docs-maruku-unittest/blanks_in_code.text b/t/docs-maruku-unittest/blanks_in_code.text new file mode 100644 index 0000000..0f2d7c3 --- /dev/null +++ b/t/docs-maruku-unittest/blanks_in_code.text @@ -0,0 +1,22 @@ +This block is composed of three lines: + + one + + three + +This block is composed of 5 + + + one + + + four + + +This block is composed of 2 + + + two + + + diff --git a/t/docs-maruku-unittest/bug_def.html b/t/docs-maruku-unittest/bug_def.html new file mode 100644 index 0000000..ba6f60c --- /dev/null +++ b/t/docs-maruku-unittest/bug_def.html @@ -0,0 +1 @@ +<p><span>test</span>:</p> diff --git a/t/docs-maruku-unittest/bug_def.text b/t/docs-maruku-unittest/bug_def.text new file mode 100644 index 0000000..8489355 --- /dev/null +++ b/t/docs-maruku-unittest/bug_def.text @@ -0,0 +1,2 @@ +[test][]: + diff --git a/t/docs-maruku-unittest/bug_table.html b/t/docs-maruku-unittest/bug_table.html new file mode 100644 index 0000000..ae94052 --- /dev/null +++ b/t/docs-maruku-unittest/bug_table.html @@ -0,0 +1,3 @@ +<p class='class1' style='color:red'>hello</p> +<table class='class1' summary='Table summary' style='color:red'><thead><tr><th>h</th><th>h</th></tr></thead><tbody><tr><th scope='row' style='text-align: left;'> c1</th><td style='text-align: left;'>c2</td> +</tr></tbody></table> diff --git a/t/docs-maruku-unittest/bug_table.text b/t/docs-maruku-unittest/bug_table.text new file mode 100644 index 0000000..f18d1b8 --- /dev/null +++ b/t/docs-maruku-unittest/bug_table.text @@ -0,0 +1,13 @@ + + +hello +{: summary="Table summary" .class1 style="color:red"} + +h | h +----------|-- +{:t} c1 | c2 +{: summary="Table summary" .class1 style="color:red"} + + + +{:t: scope="row"} diff --git a/t/docs-maruku-unittest/code.html b/t/docs-maruku-unittest/code.html new file mode 100644 index 0000000..a20950b --- /dev/null +++ b/t/docs-maruku-unittest/code.html @@ -0,0 +1,6 @@ +<p>Here is an example of AppleScript:</p> + +<pre><code>tell application "Foo" + beep +end tell + tab</code></pre> diff --git a/t/docs-maruku-unittest/code.text b/t/docs-maruku-unittest/code.text new file mode 100644 index 0000000..3656212 --- /dev/null +++ b/t/docs-maruku-unittest/code.text @@ -0,0 +1,7 @@ +Here is an example of AppleScript: + + tell application "Foo" + beep + end tell + tab + diff --git a/t/docs-maruku-unittest/code2.html b/t/docs-maruku-unittest/code2.html new file mode 100644 index 0000000..9401dba --- /dev/null +++ b/t/docs-maruku-unittest/code2.html @@ -0,0 +1,5 @@ +<blockquote> +<p>Code</p> + +<pre><code>Ciao</code></pre> +</blockquote> diff --git a/t/docs-maruku-unittest/code2.text b/t/docs-maruku-unittest/code2.text new file mode 100644 index 0000000..3f4ea50 --- /dev/null +++ b/t/docs-maruku-unittest/code2.text @@ -0,0 +1,3 @@ +> Code +> +> Ciao diff --git a/t/docs-maruku-unittest/code3.html b/t/docs-maruku-unittest/code3.html new file mode 100644 index 0000000..655a952 --- /dev/null +++ b/t/docs-maruku-unittest/code3.html @@ -0,0 +1,15 @@ +<p>This is code (4 spaces):</p> + +<pre><code>Code</code></pre> + +<p>This is not code</p> + +<pre><code>Code</code></pre> + +<p>This is code (1 tab):</p> + +<pre><code>Code</code></pre> + +<p>This is not code</p> + +<pre><code>Code</code></pre> diff --git a/t/docs-maruku-unittest/code3.text b/t/docs-maruku-unittest/code3.text new file mode 100644 index 0000000..2e7c652 --- /dev/null +++ b/t/docs-maruku-unittest/code3.text @@ -0,0 +1,17 @@ + +This is code (4 spaces): + + Code +This is not code + + Code + +This is code (1 tab): + + Code +This is not code + + Code + + + diff --git a/t/docs-maruku-unittest/convert.pl b/t/docs-maruku-unittest/convert.pl new file mode 100644 index 0000000..20346c8 --- /dev/null +++ b/t/docs-maruku-unittest/convert.pl @@ -0,0 +1,47 @@ +use strict; +use warnings; +open(LS, "ls -1 *.md|") or die; +my @list = <LS>; +close(LS); + +foreach (@list) { + chomp; + s/\.md$//; + my ($markdown, $html) = convert_to_perl_test("$_.md"); + open(MD, ">$_.text") or die; + print MD $markdown; + close(MD); + open(MD, ">$_.html") or die; + print MD $html; + close(MD); +} + +sub convert_to_perl_test { + my ($file) = @_; + my $FH; + open($FH, '<', $file) or die("Cannot open $file"); + my ($markdown, $html); + my @lines = <$FH>; + close($FH); + my $mode = 0; + foreach my $l (@lines) { + if ($l =~ /^\*\*\*/) { + $mode = 0; + if ($l =~ /Markdown input/i) { + $mode = 1; + } + if ($l =~ /Output of to_html/) { + $mode = 2; + } + } + elsif ($mode > 0) { + if (1 == $mode) { + $markdown .= $l; + } + else { + $html .= $l; + } + } + } + return ($markdown, $html); +} diff --git a/t/docs-maruku-unittest/data_loss.html b/t/docs-maruku-unittest/data_loss.html new file mode 100644 index 0000000..32463a9 --- /dev/null +++ b/t/docs-maruku-unittest/data_loss.html @@ -0,0 +1,3 @@ +<ol> +<li>abcd efgh ijkl</li> +</ol> diff --git a/t/docs-maruku-unittest/data_loss.text b/t/docs-maruku-unittest/data_loss.text new file mode 100644 index 0000000..a353aeb --- /dev/null +++ b/t/docs-maruku-unittest/data_loss.text @@ -0,0 +1,4 @@ +1. abcd +efgh +ijkl + diff --git a/t/docs-maruku-unittest/easy.html b/t/docs-maruku-unittest/easy.html new file mode 100644 index 0000000..8649e55 --- /dev/null +++ b/t/docs-maruku-unittest/easy.html @@ -0,0 +1 @@ +<p><em>Hello!</em> how are <strong>you</strong>?</p> diff --git a/t/docs-maruku-unittest/easy.text b/t/docs-maruku-unittest/easy.text new file mode 100644 index 0000000..d5ad50c --- /dev/null +++ b/t/docs-maruku-unittest/easy.text @@ -0,0 +1 @@ +*Hello!* how are **you**? diff --git a/t/docs-maruku-unittest/email.html b/t/docs-maruku-unittest/email.html new file mode 100644 index 0000000..fe1000d --- /dev/null +++ b/t/docs-maruku-unittest/email.html @@ -0,0 +1 @@ +<p>This is an email address: <a href='mailto:andrea@invalid.it'>andrea@invalid.it</a></p> diff --git a/t/docs-maruku-unittest/email.text b/t/docs-maruku-unittest/email.text new file mode 100644 index 0000000..4d154e4 --- /dev/null +++ b/t/docs-maruku-unittest/email.text @@ -0,0 +1,4 @@ + + +This is an email address: <andrea@invalid.it> + diff --git a/t/docs-maruku-unittest/entities.html b/t/docs-maruku-unittest/entities.html new file mode 100644 index 0000000..94239c6 --- /dev/null +++ b/t/docs-maruku-unittest/entities.html @@ -0,0 +1,14 @@ +<p>Maruku translates HTML entities to the equivalent in LaTeX:</p> +<table><thead><tr><th>Entity</th><th>Result</th></tr></thead><tbody><tr><td style='text-align: left;'><code>&copy;</code></td><td style='text-align: left;'>©</td> +</tr><tr><td style='text-align: left;'><code>&pound;</code></td><td style='text-align: left;'>£</td> +</tr><tr><td style='text-align: left;'><code>a&nbsp;b</code></td><td style='text-align: left;'>a b</td> +</tr><tr><td style='text-align: left;'><code>&lambda;</code></td><td style='text-align: left;'>λ</td> +</tr><tr><td style='text-align: left;'><code>&mdash;</code></td><td style='text-align: left;'>—</td> +</tr></tbody></table> +<p>Entity-substitution does not happen in code blocks or inline code.</p> + +<p>The following should not be translated:</p> + +<pre><code>&copy;</code></pre> + +<p>It should read just like this: <code>&copy;</code>.</p> diff --git a/t/docs-maruku-unittest/entities.text b/t/docs-maruku-unittest/entities.text new file mode 100644 index 0000000..7ad0b9e --- /dev/null +++ b/t/docs-maruku-unittest/entities.text @@ -0,0 +1,20 @@ +Maruku translates HTML entities to the equivalent in LaTeX: + +Entity | Result +------------|---------- +`©` | © +`£` | £ +`a b` | a b +`λ` | λ +`—` | — + + +Entity-substitution does not happen in code blocks or inline code. + +The following should not be translated: + + © + +It should read just like this: `©`. + + diff --git a/t/docs-maruku-unittest/escaping.html b/t/docs-maruku-unittest/escaping.html new file mode 100644 index 0000000..165a784 --- /dev/null +++ b/t/docs-maruku-unittest/escaping.html @@ -0,0 +1,9 @@ +<p>Hello: ! ! ` { } [ ] ( ) # . ! * * *</p> + +<p>Ora, <em>emphasis</em>, <strong>bold</strong>, * <- due asterischi-> * , un underscore-> _ , <em>emphasis</em>, incre<em>dible</em>e!</p> + +<p>This is <code>Code with a special: -> ` <-</code>(after)</p> + +<p><code>Start </code> of paragraph</p> + +<p>End of <code>paragraph </code></p> diff --git a/t/docs-maruku-unittest/escaping.text b/t/docs-maruku-unittest/escaping.text new file mode 100644 index 0000000..ff043c2 --- /dev/null +++ b/t/docs-maruku-unittest/escaping.text @@ -0,0 +1,11 @@ + Hello: ! \! \` \{ \} \[ \] \( \) \# \. \! * \* * + + +Ora, *emphasis*, **bold**, * <- due asterischi-> * , un underscore-> _ , _emphasis_, + incre*dible*e! + +This is ``Code with a special: -> ` <- ``(after) + +`Start ` of paragraph + +End of `paragraph ` diff --git a/t/docs-maruku-unittest/extra_dl.html b/t/docs-maruku-unittest/extra_dl.html new file mode 100644 index 0000000..f66d4da --- /dev/null +++ b/t/docs-maruku-unittest/extra_dl.html @@ -0,0 +1,9 @@ +<dl> +<dt>Apple</dt> + +<dd>Pomaceous fruit of plants of the genus Malus in the family Rosaceae.</dd> + +<dt>Orange</dt> + +<dd>The fruit of an evergreen tree of the genus Citrus.</dd> +</dl> diff --git a/t/docs-maruku-unittest/extra_dl.text b/t/docs-maruku-unittest/extra_dl.text new file mode 100644 index 0000000..e9c01dc --- /dev/null +++ b/t/docs-maruku-unittest/extra_dl.text @@ -0,0 +1,10 @@ +CSS: style.css + + +Apple +: Pomaceous fruit of plants of the genus Malus in + the family Rosaceae. + +Orange +: The fruit of an evergreen tree of the genus Citrus. + diff --git a/t/docs-maruku-unittest/extra_header_id.html b/t/docs-maruku-unittest/extra_header_id.html new file mode 100644 index 0000000..20ca1f6 --- /dev/null +++ b/t/docs-maruku-unittest/extra_header_id.html @@ -0,0 +1,9 @@ +<h1 id='header1'>Header 1</h1> + +<h2 id='header2'>Header 2</h2> + +<h3 id='header3'>Header 3</h3> + +<p>Then you can create links to different parts of the same document like this:</p> + +<p><a href='#header1'>Link back to header 1</a>, <a href='#header2'>Link back to header 2</a>, <a href='#header3'>Link back to header 3</a></p> diff --git a/t/docs-maruku-unittest/extra_header_id.text b/t/docs-maruku-unittest/extra_header_id.text new file mode 100644 index 0000000..969f947 --- /dev/null +++ b/t/docs-maruku-unittest/extra_header_id.text @@ -0,0 +1,14 @@ +Header 1 {#header1} +======== + +Header 2 {#header2} +-------- + +### Header 3 ### {#header3} + +Then you can create links to different parts of the same document like this: + +[Link back to header 1](#header1), +[Link back to header 2](#header2), +[Link back to header 3](#header3) + diff --git a/t/docs-maruku-unittest/extra_table1.html b/t/docs-maruku-unittest/extra_table1.html new file mode 100644 index 0000000..4c780de --- /dev/null +++ b/t/docs-maruku-unittest/extra_table1.html @@ -0,0 +1,3 @@ +<table><thead><tr><th>First Header</th><th>Second Header</th></tr></thead><tbody><tr><td style='text-align: left;'>Content Cell</td><td style='text-align: left;'>Content Cell</td> +</tr><tr><td style='text-align: left;'>Content Cell</td><td style='text-align: left;'>Content Cell</td> +</tr></tbody></table> diff --git a/t/docs-maruku-unittest/extra_table1.text b/t/docs-maruku-unittest/extra_table1.text new file mode 100644 index 0000000..769c7e7 --- /dev/null +++ b/t/docs-maruku-unittest/extra_table1.text @@ -0,0 +1,7 @@ +CSS: style.css + +First Header | Second Header +------------- | ------------- +Content Cell | Content Cell +Content Cell | Content Cell + diff --git a/t/docs-maruku-unittest/footnotes.html b/t/docs-maruku-unittest/footnotes.html new file mode 100644 index 0000000..17d1a8f --- /dev/null +++ b/t/docs-maruku-unittest/footnotes.html @@ -0,0 +1,14 @@ +<p>That’s some text with a footnote <sup id='fnref:1'><a href='#fn:1' rel='footnote'>1</a></sup> and another <sup id='fnref:2'><a href='#fn:2' rel='footnote'>2</a></sup> and another <sup id='fnref:3'><a href='#fn:3' rel='footnote'>3</a></sup>.</p> + +<p>This is not a footnote.</p> +<div class='footnotes'><hr /><ol><li id='fn:1'> +<p>And that’s the footnote. This is second sentence (same paragraph).</p> +<a href='#fnref:1' rev='footnote'>↩</a></li><li id='fn:2'> +<p>This is the very long one.</p> + +<p>That’s the second paragraph.</p> +<a href='#fnref:2' rev='footnote'>↩</a></li><li id='fn:3'> +<p>And that’s the footnote.</p> + +<p>That’s the second paragraph of the footnote.</p> +<a href='#fnref:3' rev='footnote'>↩</a></li></ol></div> diff --git a/t/docs-maruku-unittest/footnotes.text b/t/docs-maruku-unittest/footnotes.text new file mode 100644 index 0000000..05c6f99 --- /dev/null +++ b/t/docs-maruku-unittest/footnotes.text @@ -0,0 +1,17 @@ +That's some text with a footnote [^b] and another [^c] and another [^a]. + +[^a]: And that's the footnote. + + That's the second paragraph of the footnote. + + +[^b]: And that's the footnote. +This is second sentence (same paragraph). + +[^c]: + This is the very long one. + + That's the second paragraph. + + +This is not a footnote. diff --git a/t/docs-maruku-unittest/headers.html b/t/docs-maruku-unittest/headers.html new file mode 100644 index 0000000..b6d3893 --- /dev/null +++ b/t/docs-maruku-unittest/headers.html @@ -0,0 +1,5 @@ +<h1 id='a_title_with_emphasis'>A title with <em>emphasis</em></h1> + +<h2 id='a_title_with_emphasis'>A title with <em>emphasis</em></h2> + +<h4 id='a_title_with_emphasis'>A title with <em>emphasis</em></h4> diff --git a/t/docs-maruku-unittest/headers.text b/t/docs-maruku-unittest/headers.text new file mode 100644 index 0000000..387d4e9 --- /dev/null +++ b/t/docs-maruku-unittest/headers.text @@ -0,0 +1,11 @@ +A title with *emphasis* +======================= + +A title with *emphasis* +----------------------- + + +#### A title with *emphasis* #### + + + diff --git a/t/docs-maruku-unittest/hex_entities.html b/t/docs-maruku-unittest/hex_entities.html new file mode 100644 index 0000000..8741bcc --- /dev/null +++ b/t/docs-maruku-unittest/hex_entities.html @@ -0,0 +1 @@ +<p>Examples of numeric character references include © or © for the copyright symbol, Α or Α for the Greek capital letter alpha, and ا or ا for the Arabic letter alef.</p> diff --git a/t/docs-maruku-unittest/hex_entities.text b/t/docs-maruku-unittest/hex_entities.text new file mode 100644 index 0000000..98d3bfc --- /dev/null +++ b/t/docs-maruku-unittest/hex_entities.text @@ -0,0 +1,3 @@ +Examples of numeric character references include © or © for the copyright symbol, Α or Α for the Greek capital letter alpha, and ا or ا for the Arabic letter alef. + + diff --git a/t/docs-maruku-unittest/hrule.html b/t/docs-maruku-unittest/hrule.html new file mode 100644 index 0000000..b856afb --- /dev/null +++ b/t/docs-maruku-unittest/hrule.html @@ -0,0 +1 @@ +<hr /><hr /><hr /><hr /><hr /> diff --git a/t/docs-maruku-unittest/hrule.text b/t/docs-maruku-unittest/hrule.text new file mode 100644 index 0000000..8ccef4e --- /dev/null +++ b/t/docs-maruku-unittest/hrule.text @@ -0,0 +1,2 @@ +* * * + diff --git a/t/docs-maruku-unittest/html2.html b/t/docs-maruku-unittest/html2.html new file mode 100644 index 0000000..1c93e7c --- /dev/null +++ b/t/docs-maruku-unittest/html2.html @@ -0,0 +1,2 @@ +<p>One <div />123</p> +<div /> diff --git a/t/docs-maruku-unittest/html2.text b/t/docs-maruku-unittest/html2.text new file mode 100644 index 0000000..58510e2 --- /dev/null +++ b/t/docs-maruku-unittest/html2.text @@ -0,0 +1,4 @@ +One +<div></div>123 + +<div></div>123 diff --git a/t/docs-maruku-unittest/html3.html b/t/docs-maruku-unittest/html3.html new file mode 100644 index 0000000..8ca3d06 --- /dev/null +++ b/t/docs-maruku-unittest/html3.html @@ -0,0 +1 @@ +<p>taking part in <a href='http://sied.dis.uniroma1.it/'>some arcane conspirations</a> which involve <b href='http://www.flickr.com/photos/censi/70893277/'>coffee</b>, <a href='http://flickr.com/photos/censi/42775664/in/set-936677/'>robots</a>, <a href='http://www.flickr.com/photos/censi/42775888/in/set-936677/'>sushi</a>,</p> diff --git a/t/docs-maruku-unittest/html3.text b/t/docs-maruku-unittest/html3.text new file mode 100644 index 0000000..e742017 --- /dev/null +++ b/t/docs-maruku-unittest/html3.text @@ -0,0 +1,5 @@ +taking part in <a href="http://sied.dis.uniroma1.it/">some arcane conspirations</a> which +involve <b href="http://www.flickr.com/photos/censi/70893277/">coffee</b>, +<a href="http://flickr.com/photos/censi/42775664/in/set-936677/">robots</a>, +<a href="http://www.flickr.com/photos/censi/42775888/in/set-936677/">sushi</a>, + diff --git a/t/docs-maruku-unittest/html4.html b/t/docs-maruku-unittest/html4.html new file mode 100644 index 0000000..1b9c5a3 --- /dev/null +++ b/t/docs-maruku-unittest/html4.html @@ -0,0 +1,3 @@ +<div class='frame'> + <a href='http://www.flickr.com/photos/censi/54757256/' class='photo'><img src='http://static.flickr.com/27/54757256_1a2c1d2a95_m.jpg' moz-do-not-send='true' alt='' /></a> +</div> diff --git a/t/docs-maruku-unittest/html4.text b/t/docs-maruku-unittest/html4.text new file mode 100644 index 0000000..fc9c028 --- /dev/null +++ b/t/docs-maruku-unittest/html4.text @@ -0,0 +1,7 @@ +<div class="frame"> + <a class="photo" href="http://www.flickr.com/photos/censi/54757256/"><img alt="" + moz-do-not-send="true" + src="http://static.flickr.com/27/54757256_1a2c1d2a95_m.jpg" /></a> +</div> + + diff --git a/t/docs-maruku-unittest/html5.html b/t/docs-maruku-unittest/html5.html new file mode 100644 index 0000000..8ffffe2 --- /dev/null +++ b/t/docs-maruku-unittest/html5.html @@ -0,0 +1,3 @@ +<div class='frame'> + <a href='http://www.flickr.com/photos/censi/88561568/' class='photo'><img src='http://static.flickr.com/28/88561568_ab84d28245_m.jpg' height='180' moz-do-not-send='true' alt='Aperitif' width='240' /></a> + </div> diff --git a/t/docs-maruku-unittest/html5.text b/t/docs-maruku-unittest/html5.text new file mode 100644 index 0000000..5adc250 --- /dev/null +++ b/t/docs-maruku-unittest/html5.text @@ -0,0 +1,5 @@ + <div class="frame"> + <a class="photo" href="http://www.flickr.com/photos/censi/88561568/" ><img moz-do-not-send="true" src="http://static.flickr.com/28/88561568_ab84d28245_m.jpg" width="240" height="180" alt="Aperitif" /></a> + </div> + + diff --git a/t/docs-maruku-unittest/ie.html b/t/docs-maruku-unittest/ie.html new file mode 100644 index 0000000..2809bfd --- /dev/null +++ b/t/docs-maruku-unittest/ie.html @@ -0,0 +1,9 @@ +<p><code><p>here's an apostrophe & a quote "</p></code></p> + +<pre><code><p>here's an apostrophe & a quote "</p></code></pre> + +<pre lang='xml'><code class='xml' lang='xml'><p>here's an apostrophe & a quote "</p></code></pre> + +<pre><code class='not_supported' lang='not_supported'><p>here's an apostrophe & a quote "</p></code></pre> + +<pre><code class='xml' lang='xml'><span class='punct'><</span><span class='tag'>p</span><span class='punct'>></span>here's an apostrophe & a quote "<span class='punct'></</span><span class='tag'>p</span><span class='punct'>></span></code></pre> diff --git a/t/docs-maruku-unittest/ie.text b/t/docs-maruku-unittest/ie.text new file mode 100644 index 0000000..7a4cfab --- /dev/null +++ b/t/docs-maruku-unittest/ie.text @@ -0,0 +1,15 @@ +`<p>here's an apostrophe & a quote "</p>` + + <p>here's an apostrophe & a quote "</p> +{:} + + <p>here's an apostrophe & a quote "</p> +{:lang=xml} + + <p>here's an apostrophe & a quote "</p> +{:html_use_syntax=true lang=not_supported} + + <p>here's an apostrophe & a quote "</p> +{:html_use_syntax=true lang=xml} + + diff --git a/t/docs-maruku-unittest/images.html b/t/docs-maruku-unittest/images.html new file mode 100644 index 0000000..a40a804 --- /dev/null +++ b/t/docs-maruku-unittest/images.html @@ -0,0 +1,9 @@ +<p>This page does not uilizes <img src='http://jigsaw.w3.org/css-validator/images/vcss' alt='Cascading Style Sheets' /></p> + +<p>Please mouseover to see the title: <img src='http://jigsaw.w3.org/css-validator/images/vcss' alt='Cascading Style Sheets' /></p> + +<p>Please mouseover to see the title: <img src='http://jigsaw.w3.org/css-validator/images/vcss' alt='Cascading Style Sheets' /></p> + +<p>I’ll say it one more time: this page does not use <img src='http://jigsaw.w3.org/css-validator/images/vcss' alt='Cascading Style Sheets' /></p> + +<p>This is double size: <img src='http://jigsaw.w3.org/css-validator/images/vcss' alt='Cascading Style Sheets' /></p> diff --git a/t/docs-maruku-unittest/images.text b/t/docs-maruku-unittest/images.text new file mode 100644 index 0000000..7569361 --- /dev/null +++ b/t/docs-maruku-unittest/images.text @@ -0,0 +1,22 @@ + +This page does not uilizes  + + +Please mouseover to see the title:  + +Please mouseover to see the title:  + + +I'll say it one more time: this page does not use ![Cascading Style Sheets] [css] + +This is double size: ![Cascading Style Sheets] [css2] + + + +[css]: http://jigsaw.w3.org/css-validator/images/vcss "Optional title attribute" + +[css2]: http://jigsaw.w3.org/css-validator/images/vcss "Optional title attribute" class=external + style="border:0;width:188px;height:131px" + + + diff --git a/t/docs-maruku-unittest/images2.html b/t/docs-maruku-unittest/images2.html new file mode 100644 index 0000000..ad36dd0 --- /dev/null +++ b/t/docs-maruku-unittest/images2.html @@ -0,0 +1,3 @@ +<p>This is an <img src='image.jpg' alt='image' />.</p> + +<p>This is an <img src='image.jpg' alt='image' />.</p> diff --git a/t/docs-maruku-unittest/images2.text b/t/docs-maruku-unittest/images2.text new file mode 100644 index 0000000..ef97f4b --- /dev/null +++ b/t/docs-maruku-unittest/images2.text @@ -0,0 +1,7 @@ + +This is an ![image][]. + +This is an ![image]. + +[image]: image.jpg + diff --git a/t/docs-maruku-unittest/inline_html.html b/t/docs-maruku-unittest/inline_html.html new file mode 100644 index 0000000..71e7f08 --- /dev/null +++ b/t/docs-maruku-unittest/inline_html.html @@ -0,0 +1,66 @@ +<p>Input:</p> + +<pre><code><em>Emphasis</em></code></pre> + +<p>Result: <em>Emphasis</em></p> + +<p>Input:</p> + +<pre><code><img src="http://jigsaw.w3.org/css-validator/images/vcss"/></code></pre> + +<p>Result on span: <img src='http://jigsaw.w3.org/css-validator/images/vcss' /></p> + +<p>Result alone:</p> +<img src='http://jigsaw.w3.org/css-validator/images/vcss' /> +<p>Without closing:</p> +<img src='http://jigsaw.w3.org/css-validator/images/vcss' /><div> +<p> +<p>This is</p> +<em> +<p>true</p> +</em> +<p>markdown text (paragraph)</p> +</p> +<p> +<p> +<p>This is</p> +<em> +<p>true</p> +</em> +<p>markdown text (no paragraph)</p> +</p> +</p> + <p> +<p> +<p>This is</p> +<em> +<p>true</p> +</em> +<p>markdown text (block paragraph)</p> +</p> +</p> +</div><table> +<tr> +<td> +<p>This is</p> +<em> +<p>true</p> +</em> +<p>markdown text. (no par)</p> +</td> +<td> +<p>This is</p> +<em> +<p>true</p> +</em> +<p>markdown text. (par)</p> +</td> +</tr> +</table> +<p>The following is invalid HTML, and will generate an error:</p> +<pre class='markdown-html-error' style='border: solid 3px red; background-color: pink'>HTML parse error: +<table> +<td markdown="1">This is *true* markdown text. (no par)</td> +<td markdown="block">This is *true* markdown text. (par)</td> +</tr></pre><pre class='markdown-html-error' style='border: solid 3px red; background-color: pink'>HTML parse error: +</table></pre> diff --git a/t/docs-maruku-unittest/inline_html.text b/t/docs-maruku-unittest/inline_html.text new file mode 100644 index 0000000..ad89f66 --- /dev/null +++ b/t/docs-maruku-unittest/inline_html.text @@ -0,0 +1,50 @@ +CSS: style.css + +Input: + + <em>Emphasis</em> + +Result: <em>Emphasis</em> + +Input: + + <img src="http://jigsaw.w3.org/css-validator/images/vcss"/> + +Result on span: <img src="http://jigsaw.w3.org/css-validator/images/vcss"/> + +Result alone: + +<img src="http://jigsaw.w3.org/css-validator/images/vcss"/> + +Without closing: + +<img src="http://jigsaw.w3.org/css-validator/images/vcss"> + +<div markdown="1"> + This is *true* markdown text (paragraph) + + <p markdown="1"> + This is *true* markdown text (no paragraph) + </p> + <p markdown="block"> + This is *true* markdown text (block paragraph) + </p> +</div> + +<table> +<tr> +<td markdown="1">This is *true* markdown text. (no par)</td> +<td markdown="block">This is *true* markdown text. (par)</td> +</tr> +</table> + + +The following is invalid HTML, and will generate an error: + +<table> +<td markdown="1">This is *true* markdown text. (no par)</td> +<td markdown="block">This is *true* markdown text. (par)</td> +</tr> +</table> + + diff --git a/t/docs-maruku-unittest/inline_html2.html b/t/docs-maruku-unittest/inline_html2.html new file mode 100644 index 0000000..de87541 --- /dev/null +++ b/t/docs-maruku-unittest/inline_html2.html @@ -0,0 +1,3 @@ +<div> +<p>Test <strong>bold</strong></p> +</div><p>Test <strong>bold</strong></p> diff --git a/t/docs-maruku-unittest/inline_html2.text b/t/docs-maruku-unittest/inline_html2.text new file mode 100644 index 0000000..439f930 --- /dev/null +++ b/t/docs-maruku-unittest/inline_html2.text @@ -0,0 +1,2 @@ +<div markdown="1">Test **bold**</div> +<p markdown="1">Test **bold**</p> diff --git a/t/docs-maruku-unittest/links.html b/t/docs-maruku-unittest/links.html new file mode 100644 index 0000000..8425443 --- /dev/null +++ b/t/docs-maruku-unittest/links.html @@ -0,0 +1,19 @@ +<p>Search on <a href='http://www.google.com'>Google</a></p> + +<p>Search on <a href='http://www.google.com'>Google</a></p> + +<p>Search on <a href='http://www.google.com'>Google</a></p> + +<p>Search on <a href='http://www.google.com'>Google</a></p> + +<p>Search on <a href='http://images.google.com' title='Google images'>Google images</a></p> + +<p>Inline: <a href='http://google.com'>Google images</a></p> + +<p>Inline with title: <a href='http://google.com' title='Title'>Google images</a></p> + +<p>Inline with title: <a href='http://google.com' title='Title'>Google images</a></p> + +<p>Search on <a href='http://www.gogole.com'>http://www.gogole.com</a> or <a href='http://Here.com'>http://Here.com</a> or ask <a href='mailto:bill@google.com'>bill@google.com</a> or you might ask bill@google.com.</p> + +<p>If all else fails, ask <a href='http://www.google.com'>Google</a></p> diff --git a/t/docs-maruku-unittest/links.text b/t/docs-maruku-unittest/links.text new file mode 100644 index 0000000..530f5c0 --- /dev/null +++ b/t/docs-maruku-unittest/links.text @@ -0,0 +1,36 @@ + +Search on [Google][] + +Search on [Google] [] + +Search on [Google] [google] + +Search on [Google] [Google] + +Search on [Google images][] + +Inline: [Google images](http://google.com) + +Inline with title: [Google images](http://google.com "Title") + +Inline with title: [Google images]( http://google.com "Title" ) + + +Search on <http://www.gogole.com> or <http://Here.com> or ask <mailto:bill@google.com> +or you might ask bill@google.com. + +If all else fails, ask [Google](http://www.google.com) + +[google]: http://www.google.com + +[google2]: http://www.google.com 'Single quotes' + +[google3]: http://www.google.com "Double quotes" + +[google4]: http://www.google.com (Parenthesis) + +[Google Search]: + http://www.google.com "Google search" + +[Google Images]: + http://images.google.com (Google images) diff --git a/t/docs-maruku-unittest/list1.html b/t/docs-maruku-unittest/list1.html new file mode 100644 index 0000000..82824f2 --- /dev/null +++ b/t/docs-maruku-unittest/list1.html @@ -0,0 +1,9 @@ +<ul> +<li> +<p>A list item with a blockquote:</p> + +<blockquote> +<p>This is a blockquote inside a list item.</p> +</blockquote> +</li> +</ul> diff --git a/t/docs-maruku-unittest/list1.text b/t/docs-maruku-unittest/list1.text new file mode 100644 index 0000000..c3e37d8 --- /dev/null +++ b/t/docs-maruku-unittest/list1.text @@ -0,0 +1,5 @@ +* A list item with a blockquote: + + > This is a blockquote + > inside a list item. + diff --git a/t/docs-maruku-unittest/list2.html b/t/docs-maruku-unittest/list2.html new file mode 100644 index 0000000..5d180a5 --- /dev/null +++ b/t/docs-maruku-unittest/list2.html @@ -0,0 +1,11 @@ +<ul> +<li> +<p>This is a list item with two paragraphs.</p> + +<p>This is the second paragraph in the list item. You’re only required to indent the first line. Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</p> +</li> + +<li> +<p>other</p> +</li> +</ul> diff --git a/t/docs-maruku-unittest/list2.text b/t/docs-maruku-unittest/list2.text new file mode 100644 index 0000000..c1af1ad --- /dev/null +++ b/t/docs-maruku-unittest/list2.text @@ -0,0 +1,8 @@ +* This is a list item with two paragraphs. + + This is the second paragraph in the list item. You're +only required to indent the first line. Lorem ipsum dolor +sit amet, consectetuer adipiscing elit. + +* other + diff --git a/t/docs-maruku-unittest/list3.html b/t/docs-maruku-unittest/list3.html new file mode 100644 index 0000000..1460081 --- /dev/null +++ b/t/docs-maruku-unittest/list3.html @@ -0,0 +1,15 @@ +<ul> +<li> +<p>A list item with a blockquote:</p> + +<blockquote> +<p>This is a blockquote inside a list item.</p> +</blockquote> +</li> + +<li> +<p>A list item with a code block:</p> + +<pre><code><code goes here></code></pre> +</li> +</ul> diff --git a/t/docs-maruku-unittest/list3.text b/t/docs-maruku-unittest/list3.text new file mode 100644 index 0000000..e6333b0 --- /dev/null +++ b/t/docs-maruku-unittest/list3.text @@ -0,0 +1,8 @@ +* A list item with a blockquote: + + > This is a blockquote + > inside a list item. + +* A list item with a code block: + + <code goes here> diff --git a/t/docs-maruku-unittest/list4.html b/t/docs-maruku-unittest/list4.html new file mode 100644 index 0000000..45011d0 --- /dev/null +++ b/t/docs-maruku-unittest/list4.html @@ -0,0 +1,19 @@ +<p>This is a list:</p> + +<ul> +<li>one</li> + +<li>two</li> +</ul> + +<p>This is not a list: * one ciao</p> + +<p>This is a list:</p> + +<ol> +<li>one</li> + +<li>two</li> +</ol> + +<p>This is not a list: 1987. one ciao</p> diff --git a/t/docs-maruku-unittest/list4.text b/t/docs-maruku-unittest/list4.text new file mode 100644 index 0000000..0d6e9ce --- /dev/null +++ b/t/docs-maruku-unittest/list4.text @@ -0,0 +1,16 @@ +This is a list: +* one +* two + +This is not a list: +* one +ciao + +This is a list: +1. one +1. two + +This is not a list: +1987. one +ciao + diff --git a/t/docs-maruku-unittest/lists.html b/t/docs-maruku-unittest/lists.html new file mode 100644 index 0000000..c1972b2 --- /dev/null +++ b/t/docs-maruku-unittest/lists.html @@ -0,0 +1,39 @@ +<ul> +<li>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus.</li> + +<li>Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse id sem consectetuer libero luctus adipiscing.</li> + +<li>Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse id sem consectetuer libero luctus adipiscing.</li> + +<li>Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse id sem consectetuer libero luctus adipiscing.</li> + +<li>Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse id sem consectetuer libero luctus adipiscing.</li> +</ul> + +<p>Ancora</p> + +<ul> +<li> +<p>This is a list item with two paragraphs. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus.</p> + +<p>ATTENZIONE!</p> +</li> + +<li> +<p>Suspendisse id sem consectetuer libero luctus adipiscing.</p> +</li> +</ul> + +<p>Ancora</p> + +<ul> +<li> +<p>This is a list item with two paragraphs.</p> + +<p>This is the second paragraph in the list item. You’re only required to indent the first line. Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</p> +</li> + +<li> +<p>Another item in the same list.</p> +</li> +</ul> diff --git a/t/docs-maruku-unittest/lists.text b/t/docs-maruku-unittest/lists.text new file mode 100644 index 0000000..9c41e9b --- /dev/null +++ b/t/docs-maruku-unittest/lists.text @@ -0,0 +1,32 @@ +* Lorem ipsum dolor sit amet, consectetuer adipiscing elit. + Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi, + viverra nec, fringilla in, laoreet vitae, risus. +* Donec sit amet nisl. Aliquam semper ipsum sit amet velit. + Suspendisse id sem consectetuer libero luctus adipiscing. +* Donec sit amet nisl. Aliquam semper ipsum sit amet velit. +Suspendisse id sem consectetuer libero luctus adipiscing. + * Donec sit amet nisl. Aliquam semper ipsum sit amet velit. +Suspendisse id sem consectetuer libero luctus adipiscing. + * Donec sit amet nisl. Aliquam semper ipsum sit amet velit. + Suspendisse id sem consectetuer libero luctus adipiscing. + +Ancora + +* This is a list item with two paragraphs. Lorem ipsum dolor + sit amet, consectetuer adipiscing elit. Aliquam hendrerit + mi posuere lectus. + + ATTENZIONE! + +* Suspendisse id sem consectetuer libero luctus adipiscing. + + +Ancora + +* This is a list item with two paragraphs. + + This is the second paragraph in the list item. You're +only required to indent the first line. Lorem ipsum dolor +sit amet, consectetuer adipiscing elit. + +* Another item in the same list. diff --git a/t/docs-maruku-unittest/lists11.html b/t/docs-maruku-unittest/lists11.html new file mode 100644 index 0000000..3382952 --- /dev/null +++ b/t/docs-maruku-unittest/lists11.html @@ -0,0 +1 @@ +<p>- ένα</p> diff --git a/t/docs-maruku-unittest/lists11.text b/t/docs-maruku-unittest/lists11.text new file mode 100644 index 0000000..54e7ddc --- /dev/null +++ b/t/docs-maruku-unittest/lists11.text @@ -0,0 +1,2 @@ +- ένα + diff --git a/t/docs-maruku-unittest/lists6.html b/t/docs-maruku-unittest/lists6.html new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/t/docs-maruku-unittest/lists6.html @@ -0,0 +1 @@ + diff --git a/t/docs-maruku-unittest/lists6.text b/t/docs-maruku-unittest/lists6.text new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/t/docs-maruku-unittest/lists6.text @@ -0,0 +1 @@ + diff --git a/t/docs-maruku-unittest/lists7.html b/t/docs-maruku-unittest/lists7.html new file mode 100644 index 0000000..d42e22a --- /dev/null +++ b/t/docs-maruku-unittest/lists7.html @@ -0,0 +1,10 @@ +<p>Ciao</p> + +<ul> +<li>Tab * Tab * Tab</li> +</ul> +<p>Ciao</p> + +<ul> +<li>Tab * Tab * Tab</li> +</ul> diff --git a/t/docs-maruku-unittest/lists7.text b/t/docs-maruku-unittest/lists7.text new file mode 100644 index 0000000..67605b1 --- /dev/null +++ b/t/docs-maruku-unittest/lists7.text @@ -0,0 +1,6 @@ +Ciao + +* Tab + * Tab + * Tab + diff --git a/t/docs-maruku-unittest/lists7b.html b/t/docs-maruku-unittest/lists7b.html new file mode 100644 index 0000000..126e133 --- /dev/null +++ b/t/docs-maruku-unittest/lists7b.html @@ -0,0 +1,31 @@ +<ul> +<li> +a + +<ul> +<li>a1</li> + +<li>a2</li> +</ul> +</li> + +<li> +<p>b</p> +</li> +</ul> +-----| WARNING | ----- +<ul> +<li> +<p>a</p> + +<ul> +<li>a1</li> + +<li>a2</li> +</ul> +</li> + +<li> +<p>b</p> +</li> +</ul> diff --git a/t/docs-maruku-unittest/lists7b.text b/t/docs-maruku-unittest/lists7b.text new file mode 100644 index 0000000..c963508 --- /dev/null +++ b/t/docs-maruku-unittest/lists7b.text @@ -0,0 +1,6 @@ +* a + * a1 + * a2 +* b + + diff --git a/t/docs-maruku-unittest/lists8.html b/t/docs-maruku-unittest/lists8.html new file mode 100644 index 0000000..de79558 --- /dev/null +++ b/t/docs-maruku-unittest/lists8.html @@ -0,0 +1,13 @@ +<p>Here is a paragraph.</p> + +<ul> +<li>Item 1</li> + +<li>Item 2</li> + +<li>Item 3</li> +</ul> +-----| WARNING | ----- +<p>Here is a paragraph.</p> + +<p>* Item 1 * Item 2 * Item 3</p> diff --git a/t/docs-maruku-unittest/lists8.text b/t/docs-maruku-unittest/lists8.text new file mode 100644 index 0000000..d11e4a3 --- /dev/null +++ b/t/docs-maruku-unittest/lists8.text @@ -0,0 +1,7 @@ +Here is a paragraph. + + + * Item 1 + * Item 2 + * Item 3 + diff --git a/t/docs-maruku-unittest/lists9.html b/t/docs-maruku-unittest/lists9.html new file mode 100644 index 0000000..29fc1b9 --- /dev/null +++ b/t/docs-maruku-unittest/lists9.html @@ -0,0 +1,17 @@ +<ul> +<li> +<p>Due</p> + +<ol> +<li>tre</li> + +<li>tre</li> + +<li>tre</li> +</ol> +</li> + +<li> +<p>Due</p> +</li> +</ul> diff --git a/t/docs-maruku-unittest/lists9.text b/t/docs-maruku-unittest/lists9.text new file mode 100644 index 0000000..68395e8 --- /dev/null +++ b/t/docs-maruku-unittest/lists9.text @@ -0,0 +1,5 @@ +- Due + 1. tre + 1. tre + 1. tre +- Due diff --git a/t/docs-maruku-unittest/lists_after_paragraph.html b/t/docs-maruku-unittest/lists_after_paragraph.html new file mode 100644 index 0000000..8b52c96 --- /dev/null +++ b/t/docs-maruku-unittest/lists_after_paragraph.html @@ -0,0 +1,37 @@ +<p>Paragraph, list with no space: * ciao</p> + +<p>Paragraph, list with 1 space: * ciao</p> + +<p>Paragraph, list with 3 space: * ciao</p> + +<p>Paragraph, list with 4 spaces: * ciao</p> + +<p>Paragraph, list with 1 tab: * ciao</p> + +<p>Paragraph (1 space after), list with no space: * ciao</p> + +<p>Paragraph (2 spaces after), list with no space:<br />* ciao</p> + +<p>Paragraph (3 spaces after), list with no space: <br />* ciao</p> + +<p>Paragraph with block quote:</p> + +<blockquote> +<p>Quoted</p> +</blockquote> + +<p>Paragraph with header:</p> + +<h3 id='header'>header</h3> + +<p>Paragraph with header on two lines:</p> + +<h2 id='header'>header</h2> + +<p>Paragraph with html after <div /></p> + +<p>Paragraph with html after, indented: <em>Emphasis</em></p> + +<p>Paragraph with html after, indented: <em>Emphasis</em> <em>tralla</em> <em>Emph</em></p> + +<p>Paragraph with html after, indented: <em>Emphasis *tralla* Emph</em></p> diff --git a/t/docs-maruku-unittest/lists_after_paragraph.text b/t/docs-maruku-unittest/lists_after_paragraph.text new file mode 100644 index 0000000..c0be0c2 --- /dev/null +++ b/t/docs-maruku-unittest/lists_after_paragraph.text @@ -0,0 +1,45 @@ +Paragraph, list with no space: +* ciao + +Paragraph, list with 1 space: + * ciao + +Paragraph, list with 3 space: + * ciao + +Paragraph, list with 4 spaces: + * ciao + +Paragraph, list with 1 tab: + * ciao + +Paragraph (1 space after), list with no space: +* ciao + +Paragraph (2 spaces after), list with no space: +* ciao + +Paragraph (3 spaces after), list with no space: +* ciao + +Paragraph with block quote: +> Quoted + +Paragraph with header: +### header ### + +Paragraph with header on two lines: +header +------ + + +Paragraph with html after +<div></div> + +Paragraph with html after, indented: + <em>Emphasis</em> + +Paragraph with html after, indented: <em>Emphasis</em> *tralla* <em>Emph</em> + +Paragraph with html after, indented: <em>Emphasis *tralla* Emph</em> + diff --git a/t/docs-maruku-unittest/lists_ol.html b/t/docs-maruku-unittest/lists_ol.html new file mode 100644 index 0000000..4820f7d --- /dev/null +++ b/t/docs-maruku-unittest/lists_ol.html @@ -0,0 +1,61 @@ +<ol> +<li>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus.</li> + +<li>Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse id sem consectetuer libero luctus adipiscing.</li> + +<li>Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse id sem consectetuer libero luctus adipiscing.</li> + +<li>Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse id sem consectetuer libero luctus adipiscing.</li> + +<li>Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse id sem consectetuer libero luctus adipiscing.</li> +</ol> + +<p>Ancora</p> + +<ol> +<li> +<p>This is a list item with two paragraphs. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus.</p> + +<p>ATTENZIONE!</p> + +<ul> +<li> +<p>Uno</p> +</li> + +<li> +<p>Due</p> + +<ol> +<li>tre</li> + +<li>tre</li> + +<li>tre</li> +</ol> +</li> + +<li> +<p>Due</p> +</li> +</ul> +</li> + +<li> +<p>Suspendisse id sem consectetuer libero luctus adipiscing.</p> +</li> +</ol> + +<p>Ancora</p> + +<ul> +<li> +<p>This is a list item with two paragraphs.</p> + +<p>This is the second paragraph in the list item. You’re only required to indent the first line. Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</p> +</li> + +<li> +<p>Another item in the same list.</p> +</li> +</ul> diff --git a/t/docs-maruku-unittest/lists_ol.text b/t/docs-maruku-unittest/lists_ol.text new file mode 100644 index 0000000..5b94ea0 --- /dev/null +++ b/t/docs-maruku-unittest/lists_ol.text @@ -0,0 +1,39 @@ +1. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. + Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi, + viverra nec, fringilla in, laoreet vitae, risus. + 2. Donec sit amet nisl. Aliquam semper ipsum sit amet velit. + Suspendisse id sem consectetuer libero luctus adipiscing. +3. Donec sit amet nisl. Aliquam semper ipsum sit amet velit. +Suspendisse id sem consectetuer libero luctus adipiscing. + 3. Donec sit amet nisl. Aliquam semper ipsum sit amet velit. +Suspendisse id sem consectetuer libero luctus adipiscing. + 4. Donec sit amet nisl. Aliquam semper ipsum sit amet velit. + Suspendisse id sem consectetuer libero luctus adipiscing. + +Ancora + +1. This is a list item with two paragraphs. Lorem ipsum dolor + sit amet, consectetuer adipiscing elit. Aliquam hendrerit + mi posuere lectus. + + ATTENZIONE! + + - Uno + - Due + 1. tre + 1. tre + 1. tre + - Due + +2. Suspendisse id sem consectetuer libero luctus adipiscing. + + +Ancora + +* This is a list item with two paragraphs. + + This is the second paragraph in the list item. You're +only required to indent the first line. Lorem ipsum dolor +sit amet, consectetuer adipiscing elit. + +* Another item in the same list. diff --git a/t/docs-maruku-unittest/loss.html b/t/docs-maruku-unittest/loss.html new file mode 100644 index 0000000..3fc714a --- /dev/null +++ b/t/docs-maruku-unittest/loss.html @@ -0,0 +1 @@ +<br /> diff --git a/t/docs-maruku-unittest/loss.text b/t/docs-maruku-unittest/loss.text new file mode 100644 index 0000000..1f94fd6 --- /dev/null +++ b/t/docs-maruku-unittest/loss.text @@ -0,0 +1,2 @@ +<br/>123 + diff --git a/t/docs-maruku-unittest/misc_sw.html b/t/docs-maruku-unittest/misc_sw.html new file mode 100644 index 0000000..c1a7405 --- /dev/null +++ b/t/docs-maruku-unittest/misc_sw.html @@ -0,0 +1,79 @@ +<h3 id='general'>General</h3> + +<ul> +<li><em>Operating System</em> : <a href='http://www.apple.com/getamac/'>Mac OS X</a>: heaven, after the purgatory of Linux and the hell of Windows.</li> + +<li><em>Browser</em>: <a href='http://getfirefox.com/'>Firefox</a>. On a Mac, <a href='http://www.caminobrowser.org/'>Camino</a>.</li> + +<li><em>Email</em>: <a href='http://gmail.com/'>GMail</a>, “search, don’t sort” really works.</li> + +<li><em>Text Editor</em>: <a href='http://www.apple.com/getamac/'>TextMate</a>, you have to buy it, but it’s worth every penny. There are rumours that it’s been converting (recovering) Emacs users (addicts). Unfortunately, it’s Mac only. An alternative is <a href='http://www.jedit.org/'>jedit</a> (GPL, Java).</li> +</ul> + +<h3 id='development'>Development</h3> + +<ul> +<li> +<p><em>Build system</em>: <a href='http://www.cmake.org/'>cmake</a>, throw the <a href='http://sources.redhat.com/autobook/'>autotools</a> away.</p> +</li> + +<li> +<p><em>Source code control system</em>: ditch CVS for <a href='http://subversion.tigris.org'>subversion</a>.</p> +</li> + +<li> +<p><em>Project management</em>: <a href='http://trac.edgewall.org/'>Trac</a> tracks everything.</p> +</li> + +<li> +<p><em>Scripting language</em>: <a href='http://www.ruby-lang.org/'>Ruby</a> is Japanese pragmatism (and has a <a href='http://poignantguide.net/ruby/'>poignant</a> guide). Python, you say? Python is too academic and snob:</p> + +<pre><code>$ python +Python 2.4.1 (\#1, Jun 4 2005, 00:54:33) +Type "help", "copyright", "credits" or "license" for more information. +>>> exit +'Use Ctrl-D (i.e. EOF) to exit.' +>>> quit +'Use Ctrl-D (i.e. EOF) to exit.'</code></pre> +</li> + +<li> +<p><em>Java IDE</em>: <a href='http://www.borland.com/us/products/jbuilder/index.html'>JBuilder</a> is great software and has a free version (IMHO better than Eclipse). Java is not a pain anymore since it gained <a href='http://java.sun.com/j2se/1.5.0/docs/guide/language/generics.html'>generics</a> and got opensourced.</p> +</li> + +<li> +<p><em>Mark-up language</em>: HTML is so 2001, why don’t you take at look at <a href='http://en.wikipedia.org/wiki/Markdown'>Markdown</a>? <a href='data/misc_markdown.png'>Look at the source of this page</a>.</p> +</li> + +<li> +<p><em>C++ libraries</em>: * <a href='http://www.trolltech.no/'>QT</a> for GUIs. * <a href='http://www.gnu.org/software/gsl/'>GSL</a> for math. * <a href='http://www.imagemagick.org/Magick++/'>Magick++</a> for manipulating images. * <a href='http://cairographics.org/'>Cairo</a> for creating PDFs. * <a href='http://www.boost.org/'>Boost</a> for just about everything else.</p> +</li> +</ul> + +<h3 id='research'>Research</h3> + +<ul> +<li><em>Writing papers</em>: <a href='http://en.wikipedia.org/wiki/LaTeX'>LaTeX</a></li> + +<li><em>Writing papers & enjoying the process</em>: <a href='http://www.lyx.org'>LyX</a></li> + +<li><em>Handsome figures in your papers</em>: <a href='http://www.xfig.org/'>xfig</a> or, better, <a href='http://tams-www.informatik.uni-hamburg.de/applets/jfig/'>jfig</a>.</li> + +<li><em>The occasional presentation with many graphical content</em>: <a href='http://www.openoffice.org/product/impress.html'>OpenOffice Impress</a> (using the <a href='http://ooolatex.sourceforge.net/'>OOOlatex plugin</a>); the alternative is PowerPoint with the <a href='http://texpoint.necula.org/'>TexPoint</a> plugin.</li> + +<li><em>Managing BibTeX</em>: <a href='http://jabref.sourceforge.net/'>jabref</a>: multi-platform, for all your bibtex needs.</li> + +<li><em>IEEExplore and BibTeX</em>: convert citations using <a href='http://www.bibconverter.net/ieeexplore/'>BibConverter</a>.</li> +</ul> + +<h3 id='cool_websites'>Cool websites</h3> + +<ul> +<li><em>Best site in the wwworld</em>: <a href='http://en.wikipedia.org/'>Wikipedia</a></li> + +<li><a href='http://www.mutopiaproject.org/'>Mutopia</a> for sheet music; <a href='http://www.gutenberg.org/'>the Gutenberg Project</a> for books; <a href='http://www.liberliber.it/'>LiberLiber</a> for books in italian.</li> + +<li><em>Blogs</em>: <a href='http://bloglines.com/'>Bloglines</a></li> + +<li><em>Sharing photos</em>: <a href='http://www.flickr.com/'>flickr</a> exposes an API you can use.</li> +</ul> diff --git a/t/docs-maruku-unittest/misc_sw.text b/t/docs-maruku-unittest/misc_sw.text new file mode 100644 index 0000000..9dab62a --- /dev/null +++ b/t/docs-maruku-unittest/misc_sw.text @@ -0,0 +1,106 @@ +Subject: Software not painful to use +Subject_short: painless software +Topic: /misc/coolsw +Archive: no +Date: Nov 20 2006 +Order: -9.5 +inMenu: true + + +### General ### + +* *Operating System* : [Mac OS X][switch]: heaven, after the purgatory of Linux + and the hell of Windows. +* *Browser*: [Firefox][firefox]. On a Mac, [Camino][camino]. +* *Email*: [GMail][gmail], "search, don't sort" really works. +* *Text Editor*: [TextMate][textmate], you have to buy it, but it's worth every + penny. There are rumours that it's been converting (recovering) Emacs + users (addicts). Unfortunately, it's Mac only. An alternative is + [jedit][jedit] (GPL, Java). + +### Development ### + +* *Build system*: [cmake][cmake], throw the [autotools][autotools] away. +* *Source code control system*: ditch CVS for [subversion][subversion]. +* *Project management*: [Trac][trac] tracks everything. +* *Scripting language*: [Ruby][ruby] is Japanese pragmatism (and has a [poignant][poignant] guide). + Python, you say? Python is too academic and snob: + + $ python + Python 2.4.1 (\#1, Jun 4 2005, 00:54:33) + Type "help", "copyright", "credits" or "license" for more information. + >>> exit + 'Use Ctrl-D (i.e. EOF) to exit.' + >>> quit + 'Use Ctrl-D (i.e. EOF) to exit.' + +* *Java IDE*: [JBuilder][jbuilder] is great software and has a free version (IMHO better than Eclipse). Java + is not a pain anymore since it gained [generics][java-generics] and got opensourced. +* *Mark-up language*: HTML is so 2001, why don't you take at look at [Markdown][markdown]? [Look at the source of this page](data/misc_markdown.png). +* *C++ libraries*: + * [QT][qt] for GUIs. + * [GSL][gsl] for math. + * [Magick++][magick] for manipulating images. + * [Cairo][cairo] for creating PDFs. + * [Boost][boost] for just about everything else. + + +### Research ### + +* *Writing papers*: [LaTeX][latex] +* *Writing papers & enjoying the process*: [LyX][lyx] +* *Handsome figures in your papers*: [xfig][xfig] or, better, [jfig][jfig]. +* *The occasional presentation with many graphical content*: + [OpenOffice Impress][impress] (using the [OOOlatex plugin][ooolatex]); + the alternative is PowerPoint with the [TexPoint][texpoint] plugin. +* *Managing BibTeX*: [jabref][jabref]: multi-platform, for all your bibtex needs. +* *IEEExplore and BibTeX*: convert citations using [BibConverter][bibconverter]. + +### Cool websites ### + +* *Best site in the wwworld*: [Wikipedia][wikipedia] +* [Mutopia][mutopia] for sheet music; [the Gutenberg Project][gutenberg] for books; [LiberLiber][liberliber] for books in italian. +* *Blogs*: [Bloglines][bloglines] +* *Sharing photos*: [flickr][flickr] exposes an API you can use. + + +[firefox]: http://getfirefox.com/ +[gmail]: http://gmail.com/ +[bloglines]: http://bloglines.com/ +[wikipedia]: http://en.wikipedia.org/ +[ruby]: http://www.ruby-lang.org/ +[poignant]: http://poignantguide.net/ruby/ +[webgen]: http://webgen.rubyforge.org/ +[markdown]: http://daringfireball.net/projects/markdown/ +[latex]: http://en.wikipedia.org/wiki/LaTeX +[lyx]: http://www.lyx.org +[impress]: http://www.openoffice.org/product/impress.html +[ooolatex]: http://ooolatex.sourceforge.net/ +[texpoint]: http://texpoint.necula.org/ +[jabref]: http://jabref.sourceforge.net/ +[camino]: http://www.caminobrowser.org/ +[switch]: http://www.apple.com/getamac/ +[textmate]: http://www.apple.com/getamac/ +[cmake]: http://www.cmake.org/ +[xfig]: http://www.xfig.org/ +[jfig]: http://tams-www.informatik.uni-hamburg.de/applets/jfig/ +[subversion]: http://subversion.tigris.org +[jbuilder]: http://www.borland.com/us/products/jbuilder/index.html +[flickr]: http://www.flickr.com/ +[myflickr]: http://www.flickr.com/photos/censi +[bibconverter]: http://www.bibconverter.net/ieeexplore/ +[autotools]: http://sources.redhat.com/autobook/ +[jedit]: http://www.jedit.org/ +[qt]: http://www.trolltech.no/ +[gsl]: http://www.gnu.org/software/gsl/ +[magick]: http://www.imagemagick.org/Magick++/ +[cairo]: http://cairographics.org/ +[boost]: http://www.boost.org/ +[markdown]: http://en.wikipedia.org/wiki/Markdown +[trac]: http://trac.edgewall.org/ +[mutopia]: http://www.mutopiaproject.org/ +[liberliber]: http://www.liberliber.it/ +[gutenberg]: http://www.gutenberg.org/ +[java-generics]: http://java.sun.com/j2se/1.5.0/docs/guide/language/generics.html + + diff --git a/t/docs-maruku-unittest/olist.html b/t/docs-maruku-unittest/olist.html new file mode 100644 index 0000000..d349edb --- /dev/null +++ b/t/docs-maruku-unittest/olist.html @@ -0,0 +1,9 @@ +<p>This is a list:</p> + +<ol> +<li>one</li> + +<li>two</li> + +<li>three</li> +</ol> diff --git a/t/docs-maruku-unittest/olist.text b/t/docs-maruku-unittest/olist.text new file mode 100644 index 0000000..e68a659 --- /dev/null +++ b/t/docs-maruku-unittest/olist.text @@ -0,0 +1,5 @@ +This is a list: + +2. one +2. two +3. three diff --git a/t/docs-maruku-unittest/one.html b/t/docs-maruku-unittest/one.html new file mode 100644 index 0000000..e38afba --- /dev/null +++ b/t/docs-maruku-unittest/one.html @@ -0,0 +1 @@ +<p>One line</p> diff --git a/t/docs-maruku-unittest/one.text b/t/docs-maruku-unittest/one.text new file mode 100644 index 0000000..b8ab585 --- /dev/null +++ b/t/docs-maruku-unittest/one.text @@ -0,0 +1 @@ +One line diff --git a/t/docs-maruku-unittest/paragraph.html b/t/docs-maruku-unittest/paragraph.html new file mode 100644 index 0000000..b814fa2 --- /dev/null +++ b/t/docs-maruku-unittest/paragraph.html @@ -0,0 +1 @@ +<p>Paragraph</p> diff --git a/t/docs-maruku-unittest/paragraph.text b/t/docs-maruku-unittest/paragraph.text new file mode 100644 index 0000000..94258d1 --- /dev/null +++ b/t/docs-maruku-unittest/paragraph.text @@ -0,0 +1,2 @@ +Paragraph + diff --git a/t/docs-maruku-unittest/paragraphs.html b/t/docs-maruku-unittest/paragraphs.html new file mode 100644 index 0000000..1778533 --- /dev/null +++ b/t/docs-maruku-unittest/paragraphs.html @@ -0,0 +1,5 @@ +<p>Paragraph 1</p> + +<p>Paragraph 2</p> + +<p>Paragraph 3 Paragraph 4 Paragraph Br-><br />Paragraph 5</p> diff --git a/t/docs-maruku-unittest/paragraphs.text b/t/docs-maruku-unittest/paragraphs.text new file mode 100644 index 0000000..77b5ff8 --- /dev/null +++ b/t/docs-maruku-unittest/paragraphs.text @@ -0,0 +1,11 @@ +Paragraph 1 + +Paragraph 2 + + +Paragraph 3 +Paragraph 4 +Paragraph Br-> +Paragraph 5 + + diff --git a/t/docs-maruku-unittest/smartypants.html b/t/docs-maruku-unittest/smartypants.html new file mode 100644 index 0000000..cf0df19 --- /dev/null +++ b/t/docs-maruku-unittest/smartypants.html @@ -0,0 +1,17 @@ +<pre><code>'Twas a "test" to 'remember' in the '90s.</code></pre> + +<p>‘Twas a “test” to ‘remember’ in the ’90s.</p> + +<pre><code>It was --- in a sense --- really... interesting.</code></pre> + +<p>It was — in a sense — really… interesting.</p> + +<pre><code>I -- too -- met << some curly quotes >> there or <<here>>No space.</code></pre> + +<p>I – too – met « some curly quotes » there or «here»No space.</p> + +<pre><code>She was 6\"12\'.</code></pre> + +<blockquote> +<p>She was 6"12'.</p> +</blockquote> diff --git a/t/docs-maruku-unittest/smartypants.text b/t/docs-maruku-unittest/smartypants.text new file mode 100644 index 0000000..14478ea --- /dev/null +++ b/t/docs-maruku-unittest/smartypants.text @@ -0,0 +1,13 @@ + 'Twas a "test" to 'remember' in the '90s. +'Twas a "test" to 'remember' in the '90s. + + It was --- in a sense --- really... interesting. +It was --- in a sense --- really... interesting. + + I -- too -- met << some curly quotes >> there or <<here>>No space. +I -- too -- met << some curly quotes >> there or <<here>>No space. + + + She was 6\"12\'. +> She was 6\"12\'. + diff --git a/t/docs-maruku-unittest/syntax_hl.html b/t/docs-maruku-unittest/syntax_hl.html new file mode 100644 index 0000000..0c2ac27 --- /dev/null +++ b/t/docs-maruku-unittest/syntax_hl.html @@ -0,0 +1,11 @@ +<p>This is ruby code:</p> + +<pre><code>require 'maruku' + +puts Maruku.new($stdin).to_html</code></pre> + +<p>This is ruby code:</p> + +<pre><code class='ruby' lang='ruby'><span class='ident'>require</span> <span class='punct'>'</span><span class='string'>maruku</span><span class='punct'>'</span></code></pre> + +<pre><code>puts Maruku.new($stdin).to_html</code></pre> diff --git a/t/docs-maruku-unittest/syntax_hl.text b/t/docs-maruku-unittest/syntax_hl.text new file mode 100644 index 0000000..ec6d1a4 --- /dev/null +++ b/t/docs-maruku-unittest/syntax_hl.text @@ -0,0 +1,12 @@ +This is ruby code: + + require 'maruku' + + puts Maruku.new($stdin).to_html + +This is ruby code: + + require 'maruku' +{: lang=ruby html_use_syntax} + + puts Maruku.new($stdin).to_html diff --git a/t/docs-maruku-unittest/table_attributes.html b/t/docs-maruku-unittest/table_attributes.html new file mode 100644 index 0000000..5e6304d --- /dev/null +++ b/t/docs-maruku-unittest/table_attributes.html @@ -0,0 +1,2 @@ +<table cellspacing='2em' class='class1' border='3' rules='cols' frame='lhs' summary='Table summary' cellpadding='4px' width='50%' style='color:red'><thead><tr><th>h</th><th>h</th></tr></thead><tbody><tr><th scope='row' style='text-align: left;'> c1</th><td style='text-align: left;'>c2</td> +</tr></tbody></table> diff --git a/t/docs-maruku-unittest/table_attributes.text b/t/docs-maruku-unittest/table_attributes.text new file mode 100644 index 0000000..3dc217d --- /dev/null +++ b/t/docs-maruku-unittest/table_attributes.text @@ -0,0 +1,7 @@ + +h | h +----------|-- +{:t} c1 | c2 +{: summary="Table summary" .class1 style="color:red" border=3 width="50%" frame=lhs rules=cols cellspacing=2em cellpadding=4px} + +{:t: scope="row"} diff --git a/t/docs-maruku-unittest/test.html b/t/docs-maruku-unittest/test.html new file mode 100644 index 0000000..8494555 --- /dev/null +++ b/t/docs-maruku-unittest/test.html @@ -0,0 +1 @@ +<pre><code> $ python </code></pre> diff --git a/t/docs-maruku-unittest/test.text b/t/docs-maruku-unittest/test.text new file mode 100644 index 0000000..96c7f45 --- /dev/null +++ b/t/docs-maruku-unittest/test.text @@ -0,0 +1,5 @@ + + $ python + + + diff --git a/t/docs-maruku-unittest/wrapping.html b/t/docs-maruku-unittest/wrapping.html new file mode 100644 index 0000000..941a500 --- /dev/null +++ b/t/docs-maruku-unittest/wrapping.html @@ -0,0 +1,7 @@ +<p>Lorem ipsum dolor amet. Lorem ipsum dolor amet. Lorem ipsum dolor amet. Lorem ipsum dolor amet. Lorem ipsum dolor amet. Lorem ipsum dolor amet. Lorem ipsum dolor amet. Break:<br />Lorem ipsum dolor amet. Lorem ipsum dolor amet. Lorem ipsum dolor amet. Lorem ipsum dolor amet.</p> + +<ul> +<li>Lorem ipsum dolor amet. Lorem ipsum dolor amet. Lorem ipsum dolor amet. Lorem ipsum dolor amet Lorem ipsum Break:<br />Lorem ipsum dolor amet. Lorem ipsum dolor amet. Lorem ipsum dolor amet</li> + +<li>Lorem ipsum dolor amet. Lorem ipsum dolor amet. Lorem ipsum dolor amet. Lorem ipsum dolor amet</li> +</ul> diff --git a/t/docs-maruku-unittest/wrapping.text b/t/docs-maruku-unittest/wrapping.text new file mode 100644 index 0000000..fcfdd9a --- /dev/null +++ b/t/docs-maruku-unittest/wrapping.text @@ -0,0 +1,8 @@ +Lorem ipsum dolor amet. Lorem ipsum dolor amet. Lorem ipsum dolor amet. Lorem ipsum dolor amet. Lorem ipsum dolor amet. Lorem ipsum dolor amet. Lorem ipsum dolor amet. Break: +Lorem ipsum dolor amet. Lorem ipsum dolor amet. Lorem ipsum dolor amet. Lorem ipsum dolor amet. + +* Lorem ipsum dolor amet. Lorem ipsum dolor amet. Lorem ipsum dolor amet. Lorem ipsum dolor amet + Lorem ipsum Break: + Lorem ipsum dolor amet. Lorem ipsum dolor amet. Lorem ipsum dolor amet +* Lorem ipsum dolor amet. Lorem ipsum dolor amet. Lorem ipsum dolor amet. Lorem ipsum dolor amet + diff --git a/t/docs-maruku-unittest/xml.html b/t/docs-maruku-unittest/xml.html new file mode 100644 index 0000000..8b39ac8 --- /dev/null +++ b/t/docs-maruku-unittest/xml.html @@ -0,0 +1,6 @@ +<svg:svg /><svg:svg height='400px' width='600px'> + <svg:g id='group'> + <svg:circle cy='3cm' id='circ1' r='1cm' cx='3cm' style='fill:red;' /> + <svg:circle cy='3cm' id='circ2' r='1cm' cx='7cm' style='fill:red;' /> + </svg:g> +</svg:svg> diff --git a/t/docs-maruku-unittest/xml.text b/t/docs-maruku-unittest/xml.text new file mode 100644 index 0000000..98fb57c --- /dev/null +++ b/t/docs-maruku-unittest/xml.text @@ -0,0 +1,11 @@ + +<svg:svg/> + +<svg:svg +width="600px" height="400px"> + <svg:g id="group"> + <svg:circle id="circ1" r="1cm" cx="3cm" cy="3cm" style="fill:red;"></svg:circle> + <svg:circle id="circ2" r="1cm" cx="7cm" cy="3cm" style="fill:red;" /> + </svg:g> +</svg:svg> + diff --git a/t/docs-maruku-unittest/xml2.html b/t/docs-maruku-unittest/xml2.html new file mode 100644 index 0000000..54fef9b --- /dev/null +++ b/t/docs-maruku-unittest/xml2.html @@ -0,0 +1,3 @@ +<!-- +< +--> diff --git a/t/docs-maruku-unittest/xml2.text b/t/docs-maruku-unittest/xml2.text new file mode 100644 index 0000000..54fef9b --- /dev/null +++ b/t/docs-maruku-unittest/xml2.text @@ -0,0 +1,3 @@ +<!-- +< +--> diff --git a/t/docs-maruku-unittest/xml3.html b/t/docs-maruku-unittest/xml3.html new file mode 100644 index 0000000..92c8a1f --- /dev/null +++ b/t/docs-maruku-unittest/xml3.html @@ -0,0 +1,4 @@ +<table>Blah<thead> + <td><em>em</em></td> + </thead> +</table> diff --git a/t/docs-maruku-unittest/xml3.text b/t/docs-maruku-unittest/xml3.text new file mode 100644 index 0000000..17553e1 --- /dev/null +++ b/t/docs-maruku-unittest/xml3.text @@ -0,0 +1,7 @@ +<table markdown='1'> + Blah + <thead> + <td>*em*</td> + </thead> +</table> + diff --git a/t/docs-maruku-unittest/xml_instruction.html b/t/docs-maruku-unittest/xml_instruction.html new file mode 100644 index 0000000..60f8aed --- /dev/null +++ b/t/docs-maruku-unittest/xml_instruction.html @@ -0,0 +1,4 @@ +<? noTarget?><?php ?><?xml ?><?mrk ?> +<p>Targets <? noTarget?> <?php ?> <?xml ?> <?mrk ?></p> + +<p>Inside: <?mrk puts "Inside: Hello"?> last</p> diff --git a/t/docs-maruku-unittest/xml_instruction.text b/t/docs-maruku-unittest/xml_instruction.text new file mode 100644 index 0000000..7e42a41 --- /dev/null +++ b/t/docs-maruku-unittest/xml_instruction.text @@ -0,0 +1,11 @@ + +<? noTarget?> +<?php ?> +<?xml ?> +<?mrk ?> + +Targets <? noTarget?> <?php ?> <?xml ?> <?mrk ?> + +Inside: <?mrk puts "Inside: Hello" ?> last + + diff --git a/t/docs-php-markdown-extra/Abbr.html b/t/docs-php-markdown-extra/Abbr.html new file mode 100644 index 0000000..89d618d --- /dev/null +++ b/t/docs-php-markdown-extra/Abbr.html @@ -0,0 +1,11 @@ +<p>Some text about <abbr title="Hyper Text Markup Language">HTML</abbr>, <abbr title="Standard Generalized Markup Language">SGML</abbr> and <abbr title="Hyper Text Markup Language version 4">HTML4</abbr>.</p> + +<p>Let's talk about the <abbr title="United States of America">U.S.A.</abbr>, (<abbr title="États-Unis d'Amérique">É.U.</abbr> or <abbr title="États-Unis d'Amérique">É.-U. d'A.</abbr> in French).</p> + +<p>And here we have a <abbr title="Compact Disk">CD</abbr>, some CDs, and some other <abbr title="Compact Disk">CD</abbr>'s.</p> + +<p>Let's transfert documents through <abbr title="Transmission Control Protocol">TCP</abbr>/<abbr title="Internet Protocol">IP</abbr>, using <abbr title="Transmission Control Protocol">TCP</abbr> packets.</p> + +<hr /> + +<p>Bienvenue sur <a href="http://www.bidulecms.com" title="Bidule CMS"><abbr title="Content Management System">CMS</abbr></a>.</p> diff --git a/t/docs-php-markdown-extra/Abbr.text b/t/docs-php-markdown-extra/Abbr.text new file mode 100644 index 0000000..5dd4ef2 --- /dev/null +++ b/t/docs-php-markdown-extra/Abbr.text @@ -0,0 +1,25 @@ +Some text about HTML, SGML and HTML4. + +Let's talk about the U.S.A., (É.U. or É.-U. d'A. in French). + +*[HTML4]: Hyper Text Markup Language version 4 +*[HTML]: Hyper Text Markup Language +*[SGML]: Standard Generalized Markup Language +*[U.S.A.]: United States of America +*[É.U.] : États-Unis d'Amérique +*[É.-U. d'A.] : États-Unis d'Amérique + +And here we have a CD, some CDs, and some other CD's. + +*[CD]: Compact Disk + +Let's transfert documents through TCP/IP, using TCP packets. + +*[IP]: Internet Protocol +*[TCP]: Transmission Control Protocol + + --- + +Bienvenue sur [CMS](http://www.bidulecms.com "Bidule CMS"). + +*[CMS]: Content Management System
\ No newline at end of file diff --git a/t/docs-php-markdown-extra/Definition_Lists.html b/t/docs-php-markdown-extra/Definition_Lists.html new file mode 100644 index 0000000..0ab9f40 --- /dev/null +++ b/t/docs-php-markdown-extra/Definition_Lists.html @@ -0,0 +1,142 @@ +<p>A simple definition list:</p> + +<dl> +<dt>Term 1</dt> +<dd>Definition 1</dd> + +<dt>Term 2</dt> +<dd>Definition 2</dd> +</dl> + +<p>With multiple terms:</p> + +<dl> +<dt>Term 1</dt> +<dt>Term 2</dt> +<dd>Definition 1</dd> + +<dt>Term 3</dt> +<dt>Term 4</dt> +<dd>Definition 2</dd> +</dl> + +<p>With multiple definitions:</p> + +<dl> +<dt>Term 1</dt> +<dd>Definition 1</dd> + +<dd>Definition 2</dd> + +<dt>Term 2</dt> +<dd>Definition 3</dd> + +<dd>Definition 4</dd> +</dl> + +<p>With multiple lines per definition:</p> + +<dl> +<dt>Term 1</dt> +<dd>Definition 1 line 1 ... +Definition 1 line 2</dd> + +<dd>Definition 2 line 1 ... +Definition 2 line 2</dd> + +<dt>Term 2</dt> +<dd>Definition 3 line 2 ... +Definition 3 line 2</dd> + +<dd>Definition 4 line 2 ... +Definition 4 line 2</dd> +</dl> + +<p>With paragraphs:</p> + +<dl> +<dt>Term 1</dt> +<dd> +<p>Definition 1 (paragraph)</p> +</dd> + +<dt>Term 2</dt> +<dd> +<p>Definition 2 (paragraph)</p> +</dd> +</dl> + +<p>With multiple paragraphs:</p> + +<dl> +<dt>Term 1</dt> +<dd> +<p>Definition 1 paragraph 1 line 1 ... +Definition 1 paragraph 1 line 2</p> + +<p>Definition 1 paragraph 2 line 1 ... +Definition 1 paragraph 2 line 2</p> +</dd> + +<dt>Term 2</dt> +<dd> +<p>Definition 1 paragraph 1 line 1 ... +Definition 1 paragraph 1 line 2 (lazy)</p> + +<p>Definition 1 paragraph 2 line 1 ... +Definition 1 paragraph 2 line 2 (lazy)</p> +</dd> +</dl> + +<hr /> + +<p>A mix:</p> + +<dl> +<dt>Term 1</dt> +<dt>Term 2</dt> +<dd> +<p>Definition 1 paragraph 1 line 1 ... +Definition 1 paragraph 1 line 2 (lazy)</p> + +<p>Definition 1 paragraph 2 line 1 ... +Definition 1 paragraph 2 line 2</p> +</dd> + +<dd> +<p>Definition 2 paragraph 1 line 1 ... +Definition 2 paragraph 1 line 2 (lazy)</p> +</dd> + +<dt>Term 3</dt> +<dd>Definition 3 (no paragraph)</dd> + +<dd>Definition 4 (no paragraph)</dd> + +<dd>Definition 5 line 1 ... +Definition 5 line 2 (no paragraph)</dd> + +<dd> +<p>Definition 6 paragraph 1 line 1 ... +Definition 6 paragraph 1 line 2</p> +</dd> + +<dd>Definition 7 (no paragraph)</dd> + +<dd> +<p>Definition 8 paragraph 1 line 1 (forced paragraph) ... +Definition 8 paragraph 1 line 2</p> + +<p>Definition 8 paragraph 2 line 1</p> +</dd> + +<dt>Term 4</dt> +<dd> +<p>Definition 9 paragraph 1 line 1 (forced paragraph) ... +Definition 9 paragraph 1 line 2</p> + +<p>Definition 9 paragraph 2 line 1</p> +</dd> + +<dd>Definition 10 (no paragraph)</dd> +</dl> diff --git a/t/docs-php-markdown-extra/Definition_Lists.text b/t/docs-php-markdown-extra/Definition_Lists.text new file mode 100644 index 0000000..eae1fb5 --- /dev/null +++ b/t/docs-php-markdown-extra/Definition_Lists.text @@ -0,0 +1,106 @@ +A simple definition list: + +Term 1 +: Definition 1 + +Term 2 +: Definition 2 + +With multiple terms: + +Term 1 +Term 2 +: Definition 1 + +Term 3 +Term 4 +: Definition 2 + +With multiple definitions: + +Term 1 +: Definition 1 +: Definition 2 + +Term 2 +: Definition 3 +: Definition 4 + +With multiple lines per definition: + +Term 1 +: Definition 1 line 1 ... +Definition 1 line 2 +: Definition 2 line 1 ... +Definition 2 line 2 + +Term 2 +: Definition 3 line 2 ... + Definition 3 line 2 +: Definition 4 line 2 ... + Definition 4 line 2 + +With paragraphs: + +Term 1 + +: Definition 1 (paragraph) + +Term 2 + +: Definition 2 (paragraph) + +With multiple paragraphs: + +Term 1 + +: Definition 1 paragraph 1 line 1 ... + Definition 1 paragraph 1 line 2 + + Definition 1 paragraph 2 line 1 ... + Definition 1 paragraph 2 line 2 + +Term 2 + +: Definition 1 paragraph 1 line 1 ... +Definition 1 paragraph 1 line 2 (lazy) + + Definition 1 paragraph 2 line 1 ... +Definition 1 paragraph 2 line 2 (lazy) + +* * * + +A mix: + +Term 1 +Term 2 + +: Definition 1 paragraph 1 line 1 ... +Definition 1 paragraph 1 line 2 (lazy) + + Definition 1 paragraph 2 line 1 ... + Definition 1 paragraph 2 line 2 + +: Definition 2 paragraph 1 line 1 ... +Definition 2 paragraph 1 line 2 (lazy) + +Term 3 +: Definition 3 (no paragraph) +: Definition 4 (no paragraph) +: Definition 5 line 1 ... + Definition 5 line 2 (no paragraph) + +: Definition 6 paragraph 1 line 1 ... +Definition 6 paragraph 1 line 2 +: Definition 7 (no paragraph) +: Definition 8 paragraph 1 line 1 (forced paragraph) ... + Definition 8 paragraph 1 line 2 + + Definition 8 paragraph 2 line 1 + +Term 4 +: Definition 9 paragraph 1 line 1 (forced paragraph) ... + Definition 9 paragraph 1 line 2 + + Definition 9 paragraph 2 line 1 +: Definition 10 (no paragraph)
\ No newline at end of file diff --git a/t/docs-php-markdown-extra/Emphasis.html b/t/docs-php-markdown-extra/Emphasis.html new file mode 100644 index 0000000..dfb11a7 --- /dev/null +++ b/t/docs-php-markdown-extra/Emphasis.html @@ -0,0 +1,72 @@ +<p>Combined emphasis:</p> + +<ol> +<li><strong><em>test test</em></strong></li> +<li><strong><em>test test</em></strong></li> +<li><em>test <strong>test</strong></em></li> +<li><strong>test <em>test</em></strong></li> +<li><strong><em>test</em> test</strong></li> +<li><em><strong>test</strong> test</em></li> +<li><strong><em>test</em> test</strong></li> +<li><strong>test <em>test</em></strong></li> +<li><em>test <strong>test</strong></em></li> +<li><em>test <strong>test</strong></em></li> +<li><strong>test <em>test</em></strong></li> +<li><strong><em>test</em> test</strong></li> +<li><em><strong>test</strong> test</em></li> +<li><strong><em>test</em> test</strong></li> +<li><strong>test <em>test</em></strong></li> +<li><em>test <strong>test</strong></em></li> +</ol> + +<p>Incorrect nesting:</p> + +<ol> +<li>*test <strong>test* test</strong></li> +<li>_test <strong>test_ test</strong></li> +<li>**test <em>test</em>* test*</li> +<li>__test <em>test</em>_ test_</li> +<li><em>test *test</em> test*</li> +<li><em>test _test</em> test_</li> +<li><strong>test <strong>test</strong> test</strong></li> +<li><strong>test <strong>test</strong> test</strong></li> +</ol> + +<p>No emphasis:</p> + +<ol> +<li>test* test *test</li> +<li>test** test **test</li> +<li>test_ test _test</li> +<li>test__ test __test</li> +</ol> + +<p>Middle-word emphasis (asterisks):</p> + +<ol> +<li><em>a</em>b</li> +<li>a<em>b</em></li> +<li>a<em>b</em>c</li> +<li><strong>a</strong>b</li> +<li>a<strong>b</strong></li> +<li>a<strong>b</strong>c</li> +</ol> + +<p>Middle-word emphasis (underscore):</p> + +<ol> +<li>_a_b</li> +<li>a_b_</li> +<li>a_b_c</li> +<li>__a__b</li> +<li>a__b__</li> +<li>a__b__c</li> +</ol> + +<p>my_precious_file.txt</p> + +<h2>Tricky Cases</h2> + +<p>E**. <strong>Test</strong> TestTestTest</p> + +<p>E**. <strong>Test</strong> Test Test Test</p> diff --git a/t/docs-php-markdown-extra/Emphasis.text b/t/docs-php-markdown-extra/Emphasis.text new file mode 100644 index 0000000..ec48dec --- /dev/null +++ b/t/docs-php-markdown-extra/Emphasis.text @@ -0,0 +1,69 @@ +Combined emphasis: + +1. ***test test*** +2. ___test test___ +3. *test **test*** +4. **test *test*** +5. ***test* test** +6. ***test** test* +7. ***test* test** +8. **test *test*** +9. *test **test*** +10. _test __test___ +11. __test _test___ +12. ___test_ test__ +13. ___test__ test_ +14. ___test_ test__ +15. __test _test___ +16. _test __test___ + + +Incorrect nesting: + +1. *test **test* test** +2. _test __test_ test__ +3. **test *test** test* +4. __test _test__ test_ +5. *test *test* test* +6. _test _test_ test_ +7. **test **test** test** +8. __test __test__ test__ + + + +No emphasis: + +1. test* test *test +2. test** test **test +3. test_ test _test +4. test__ test __test + + + +Middle-word emphasis (asterisks): + +1. *a*b +2. a*b* +3. a*b*c +4. **a**b +5. a**b** +6. a**b**c + + +Middle-word emphasis (underscore): + +1. _a_b +2. a_b_ +3. a_b_c +4. __a__b +5. a__b__ +6. a__b__c + +my_precious_file.txt + + +## Tricky Cases + +E**. **Test** TestTestTest + +E**. **Test** Test Test Test diff --git a/t/docs-php-markdown-extra/Footnotes.html b/t/docs-php-markdown-extra/Footnotes.html new file mode 100644 index 0000000..d689588 --- /dev/null +++ b/t/docs-php-markdown-extra/Footnotes.html @@ -0,0 +1,83 @@ +<p>This is the first paragraph.<sup id="fnref:first"><a href="#fn:first" rel="footnote">1</a></sup></p> + +<ul> +<li>List item one.<sup id="fnref:second"><a href="#fn:second" rel="footnote">2</a></sup></li> +<li>List item two.<sup id="fnref:third"><a href="#fn:third" rel="footnote">3</a></sup></li> +</ul> + +<h1>Header<sup id="fnref:fourth"><a href="#fn:fourth" rel="footnote">4</a></sup></h1> + +<p>Some paragraph with a footnote<sup id="fnref:1"><a href="#fn:1" rel="footnote">5</a></sup>, and another<sup id="fnref:2"><a href="#fn:2" rel="footnote">6</a></sup>.</p> + +<p>Another paragraph with a named footnote<sup id="fnref:fn-name"><a href="#fn:fn-name" rel="footnote">7</a></sup>.</p> + +<p>This paragraph should not have a footnote marker since +the footnote is undefined.[^3]</p> + +<p>This paragraph should not have a footnote marker since +the footnote has already been used before.[^1]</p> + +<p>This paragraph links to a footnote with plenty of +block-level content.<sup id="fnref:block"><a href="#fn:block" rel="footnote">8</a></sup></p> + +<p>This paragraph host the footnote reference within a +footnote test<sup id="fnref:reference"><a href="#fn:reference" rel="footnote">9</a></sup>.</p> + +<div class="footnotes"> +<hr /> +<ol> + +<li id="fn:first"> +<p>This is the first note. <a href="#fnref:first" rev="footnote">↩</a></p> +</li> + +<li id="fn:second"> +<p>This is the second note. <a href="#fnref:second" rev="footnote">↩</a></p> +</li> + +<li id="fn:third"> +<p>This is the third note, defined out of order. <a href="#fnref:third" rev="footnote">↩</a></p> +</li> + +<li id="fn:fourth"> +<p>This is the fourth note. <a href="#fnref:fourth" rev="footnote">↩</a></p> +</li> + +<li id="fn:1"> +<p>Content for fifth footnote. <a href="#fnref:1" rev="footnote">↩</a></p> +</li> + +<li id="fn:2"> +<p>Content for sixth footnote spaning on +three lines, with some span-level markup like +<em>emphasis</em>, a <a href="http://www.michelf.com/">link</a>. <a href="#fnref:2" rev="footnote">↩</a></p> +</li> + +<li id="fn:fn-name"> +<p>Footnote beginning on the line next to the marker. <a href="#fnref:fn-name" rev="footnote">↩</a></p> +</li> + +<li id="fn:block"> +<p>Paragraph.</p> + +<ul> +<li>List item</li> +</ul> + +<blockquote> + <p>Blockquote</p> +</blockquote> + +<pre><code>Code block +</code></pre> + +<p><a href="#fnref:block" rev="footnote">↩</a></p> +</li> + +<li id="fn:reference"> +<p>This footnote attemps to refer to another footnote. This +should be impossible.[^impossible] <a href="#fnref:reference" rev="footnote">↩</a></p> +</li> + +</ol> +</div> diff --git a/t/docs-php-markdown-extra/Footnotes.text b/t/docs-php-markdown-extra/Footnotes.text new file mode 100644 index 0000000..d2cadf1 --- /dev/null +++ b/t/docs-php-markdown-extra/Footnotes.text @@ -0,0 +1,55 @@ +This is the first paragraph.[^first] + +[^first]: This is the first note. + +* List item one.[^second] +* List item two.[^third] + +[^third]: This is the third note, defined out of order. +[^second]: This is the second note. +[^fourth]: This is the fourth note. + +# Header[^fourth] + +Some paragraph with a footnote[^1], and another[^2]. + +[^1]: Content for fifth footnote. +[^2]: Content for sixth footnote spaning on + three lines, with some span-level markup like + _emphasis_, a [link][]. + +[link]: http://www.michelf.com/ + +Another paragraph with a named footnote[^fn-name]. + +[^fn-name]: + Footnote beginning on the line next to the marker. + +This paragraph should not have a footnote marker since +the footnote is undefined.[^3] + +This paragraph should not have a footnote marker since +the footnote has already been used before.[^1] + +This paragraph links to a footnote with plenty of +block-level content.[^block] + +[^block]: + Paragraph. + + * List item + + > Blockquote + + Code block + +This paragraph host the footnote reference within a +footnote test[^reference]. + +[^reference]: + This footnote attemps to refer to another footnote. This + should be impossible.[^impossible] + +[^impossible]: + This footnote should not appear, as it is refered from + another footnote, which is not allowed. diff --git a/t/docs-php-markdown-extra/Inline_HTML_with_Markdown_content.html b/t/docs-php-markdown-extra/Inline_HTML_with_Markdown_content.html new file mode 100644 index 0000000..4751f78 --- /dev/null +++ b/t/docs-php-markdown-extra/Inline_HTML_with_Markdown_content.html @@ -0,0 +1,125 @@ +<h1>Markdown inside code blocks</h1> + +<div> + +<p>foo</p> + +</div> + +<div> + +<p>foo</p> + +</div> + +<div> + +<p>foo</p> + +</div> + +<table> +<tr><td>test <em>emphasis</em> (span)</td></tr> +</table> + +<table> +<tr><td>test <em>emphasis</em> (span)</td></tr> +</table> + +<table> +<tr><td> + +<p>test <em>emphasis</em> (block)</p> + +</td></tr> +</table> + +<h2>More complicated</h2> + +<table> +<tr><td> +* this is <em>not</em> a list item</td></tr> +<tr><td> +* this is <em>not</em> a list item</td></tr> +<tr><td> + +<ul> +<li>this <em>is</em> a list item</li> +</ul> + +</td></tr> +</table> + +<h2>With indent</h2> + +<div> + <div> + +<p>This text is no code block: if it was, the +closing <code><div></code> would be too and the HTML block +would be invalid.</p> + +<p>Markdown content in HTML blocks is assumed to be +indented the same as the block opening tag.</p> + +<p><strong>This should be the third paragraph after the header.</strong></p> + +</div> +</div> + +<h2>Code block with rogue <code></div></code>s in Markdown code span and block</h2> + +<div> + <div> + +<p>This is a code block however:</p> + +<pre><code></div> +</code></pre> + +<p>Funny isn't it? Here is a code span: <code></div></code>.</p> + +</div> +</div> + +<div> + <div> + +<ul> +<li>List item, not a code block</li> +</ul> + +<p>Some text</p> + +<pre><code>This is a code block. +</code></pre> + +</div> +</div> + +<h2>No code block in markdown span mode</h2> + +<p> + This is not a code block since Markdown parse paragraph + content as span. Code spans like <code></p></code> are allowed though. +</p> + +<p><em>Hello</em> <em>world</em></p> + +<h2>Preserving attributes and tags on more than one line:</h2> + +<p class="test" +id="12"> +Some <em>span</em> content. +</p> + +<h2>Header confusion bug</h2> + +<table class="canvas"> +<tr> +<td id="main">Hello World! +============ + +Hello World!</td> +</tr> +</table>
\ No newline at end of file diff --git a/t/docs-php-markdown-extra/Inline_HTML_with_Markdown_content.text b/t/docs-php-markdown-extra/Inline_HTML_with_Markdown_content.text new file mode 100644 index 0000000..1eb5450 --- /dev/null +++ b/t/docs-php-markdown-extra/Inline_HTML_with_Markdown_content.text @@ -0,0 +1,104 @@ +# Markdown inside code blocks + +<div markdown="1"> +foo +</div> + +<div markdown='1'> +foo +</div> + +<div markdown=1> +foo +</div> + +<table> +<tr><td markdown="1">test _emphasis_ (span)</td></tr> +</table> + +<table> +<tr><td markdown="span">test _emphasis_ (span)</td></tr> +</table> + +<table> +<tr><td markdown="block">test _emphasis_ (block)</td></tr> +</table> + +## More complicated + +<table> +<tr><td markdown="1"> +* this is _not_ a list item</td></tr> +<tr><td markdown="span"> +* this is _not_ a list item</td></tr> +<tr><td markdown="block"> +* this _is_ a list item +</td></tr> +</table> + +## With indent + +<div> + <div markdown="1"> + This text is no code block: if it was, the + closing `<div>` would be too and the HTML block + would be invalid. + + Markdown content in HTML blocks is assumed to be + indented the same as the block opening tag. + + **This should be the third paragraph after the header.** + </div> +</div> + +## Code block with rogue `</div>`s in Markdown code span and block + +<div> + <div markdown="1"> + + This is a code block however: + + </div> + + Funny isn't it? Here is a code span: `</div>`. + + </div> +</div> + +<div> + <div markdown="1"> + * List item, not a code block + +Some text + + This is a code block. + </div> +</div> + +## No code block in markdown span mode + +<p markdown="1"> + This is not a code block since Markdown parse paragraph + content as span. Code spans like `</p>` are allowed though. +</p> + +<p markdown="1">_Hello_ _world_</p> + +## Preserving attributes and tags on more than one line: + +<p class="test" markdown="1" +id="12"> +Some _span_ content. +</p> + + +## Header confusion bug + +<table class="canvas"> +<tr> +<td id="main" markdown="1">Hello World! +============ + +Hello World!</td> +</tr> +</table> diff --git a/t/docs-php-markdown-extra/Tables.html b/t/docs-php-markdown-extra/Tables.html new file mode 100644 index 0000000..e36286c --- /dev/null +++ b/t/docs-php-markdown-extra/Tables.html @@ -0,0 +1,310 @@ +<h1>Simple tables</h1> + +<table> +<thead> +<tr> + <th>Header 1</th> + <th>Header 2</th> +</tr> +</thead> +<tbody> +<tr> + <td>Cell 1</td> + <td>Cell 2</td> +</tr> +<tr> + <td>Cell 3</td> + <td>Cell 4</td> +</tr> +</tbody> +</table> + +<p>With leading pipes:</p> + +<table> +<thead> +<tr> + <th>Header 1</th> + <th>Header 2</th> +</tr> +</thead> +<tbody> +<tr> + <td>Cell 1</td> + <td>Cell 2</td> +</tr> +<tr> + <td>Cell 3</td> + <td>Cell 4</td> +</tr> +</tbody> +</table> + +<p>With tailing pipes:</p> + +<table> +<thead> +<tr> + <th>Header 1</th> + <th>Header 2</th> +</tr> +</thead> +<tbody> +<tr> + <td>Cell 1</td> + <td>Cell 2</td> +</tr> +<tr> + <td>Cell 3</td> + <td>Cell 4</td> +</tr> +</tbody> +</table> + +<p>With leading and tailing pipes:</p> + +<table> +<thead> +<tr> + <th>Header 1</th> + <th>Header 2</th> +</tr> +</thead> +<tbody> +<tr> + <td>Cell 1</td> + <td>Cell 2</td> +</tr> +<tr> + <td>Cell 3</td> + <td>Cell 4</td> +</tr> +</tbody> +</table> + +<hr /> + +<h1>One-column one-row table</h1> + +<p>With leading pipes:</p> + +<table> +<thead> +<tr> + <th>Header</th> +</tr> +</thead> +<tbody> +<tr> + <td>Cell</td> +</tr> +</tbody> +</table> + +<p>With tailing pipes:</p> + +<table> +<thead> +<tr> + <th>Header</th> +</tr> +</thead> +<tbody> +<tr> + <td>Cell</td> +</tr> +</tbody> +</table> + +<p>With leading and tailing pipes:</p> + +<table> +<thead> +<tr> + <th>Header</th> +</tr> +</thead> +<tbody> +<tr> + <td>Cell</td> +</tr> +</tbody> +</table> + +<hr /> + +<p>Table alignement:</p> + +<table> +<thead> +<tr> + <th>Default</th> + <th align="left">Right</th> + <th align="center">Center</th> + <th align="right">Left</th> +</tr> +</thead> +<tbody> +<tr> + <td>Long Cell</td> + <td align="left">Long Cell</td> + <td align="center">Long Cell</td> + <td align="right">Long Cell</td> +</tr> +<tr> + <td>Cell</td> + <td align="left">Cell</td> + <td align="center">Cell</td> + <td align="right">Cell</td> +</tr> +</tbody> +</table> + +<p>Table alignement (alternate spacing):</p> + +<table> +<thead> +<tr> + <th>Default</th> + <th align="left">Right</th> + <th align="center">Center</th> + <th align="right">Left</th> +</tr> +</thead> +<tbody> +<tr> + <td>Long Cell</td> + <td align="left">Long Cell</td> + <td align="center">Long Cell</td> + <td align="right">Long Cell</td> +</tr> +<tr> + <td>Cell</td> + <td align="left">Cell</td> + <td align="center">Cell</td> + <td align="right">Cell</td> +</tr> +</tbody> +</table> + +<hr /> + +<h1>Empty cells</h1> + +<table> +<thead> +<tr> + <th>Header 1</th> + <th>Header 2</th> +</tr> +</thead> +<tbody> +<tr> + <td>A</td> + <td>B</td> +</tr> +<tr> + <td>C</td> + <td></td> +</tr> +</tbody> +</table> + +<table> +<thead> +<tr> + <th>Header 1</th> + <th>Header 2</th> +</tr> +</thead> +<tbody> +<tr> + <td>A</td> + <td>B</td> +</tr> +<tr> + <td></td> + <td>D</td> +</tr> +</tbody> +</table> + +<hr /> + +<h1>Missing tailing pipe</h1> + +<table> +<thead> +<tr> + <th>Header 1</th> + <th>Header 2</th> +</tr> +</thead> +<tbody> +<tr> + <td>Cell</td> + <td>Cell</td> +</tr> +<tr> + <td>Cell</td> + <td>Cell</td> +</tr> +</tbody> +</table> + +<table> +<thead> +<tr> + <th>Header 1</th> + <th>Header 2</th> +</tr> +</thead> +<tbody> +<tr> + <td>Cell</td> + <td>Cell</td> +</tr> +<tr> + <td>Cell</td> + <td>Cell</td> +</tr> +</tbody> +</table> + +<table> +<thead> +<tr> + <th>Header 1</th> + <th>Header 2</th> +</tr> +</thead> +<tbody> +<tr> + <td>Cell</td> + <td>Cell</td> +</tr> +<tr> + <td>Cell</td> + <td>Cell</td> +</tr> +</tbody> +</table> + +<table> +<thead> +<tr> + <th>Header 1</th> + <th>Header 2</th> +</tr> +</thead> +<tbody> +<tr> + <td>Cell</td> + <td>Cell</td> +</tr> +<tr> + <td>Cell</td> + <td>Cell</td> +</tr> +</tbody> +</table>
\ No newline at end of file diff --git a/t/docs-php-markdown-extra/Tables.text b/t/docs-php-markdown-extra/Tables.text new file mode 100644 index 0000000..71b93ca --- /dev/null +++ b/t/docs-php-markdown-extra/Tables.text @@ -0,0 +1,104 @@ +# Simple tables + +Header 1 | Header 2 +--------- | --------- +Cell 1 | Cell 2 +Cell 3 | Cell 4 + +With leading pipes: + +| Header 1 | Header 2 +| --------- | --------- +| Cell 1 | Cell 2 +| Cell 3 | Cell 4 + +With tailing pipes: + +Header 1 | Header 2 | +--------- | --------- | +Cell 1 | Cell 2 | +Cell 3 | Cell 4 | + +With leading and tailing pipes: + +| Header 1 | Header 2 | +| --------- | --------- | +| Cell 1 | Cell 2 | +| Cell 3 | Cell 4 | + +* * * + +# One-column one-row table + +With leading pipes: + +| Header +| ------- +| Cell + +With tailing pipes: + +Header | +------- | +Cell | + +With leading and tailing pipes: + +| Header | +| ------- | +| Cell | + +* * * + +Table alignement: + +| Default | Right | Center | Left | +| --------- |:--------- |:---------:| ---------:| +| Long Cell | Long Cell | Long Cell | Long Cell | +| Cell | Cell | Cell | Cell | + +Table alignement (alternate spacing): + +| Default | Right | Center | Left | +| --------- | :-------- | :-------: | --------: | +| Long Cell | Long Cell | Long Cell | Long Cell | +| Cell | Cell | Cell | Cell | + +* * * + +# Empty cells + +| Header 1 | Header 2 | +| --------- | --------- | +| A | B | +| C | | + +Header 1 | Header 2 +--------- | --------- +A | B + | D + +* * * + +# Missing tailing pipe + +Header 1 | Header 2 +--------- | --------- | +Cell | Cell | +Cell | Cell | + +Header 1 | Header 2 | +--------- | --------- +Cell | Cell | +Cell | Cell | + +Header 1 | Header 2 | +--------- | --------- | +Cell | Cell +Cell | Cell | + +Header 1 | Header 2 | +--------- | --------- | +Cell | Cell | +Cell | Cell + diff --git a/t/docs-php-markdown-todo/Email_auto_links.html b/t/docs-php-markdown-todo/Email_auto_links.html new file mode 100644 index 0000000..a32c408 --- /dev/null +++ b/t/docs-php-markdown-todo/Email_auto_links.html @@ -0,0 +1,3 @@ +<p><a href="mailto:michel.fortin@michelf.com">michel.fortin@michelf.com</a></p> + +<p>International domain names: <a href="mailto:help@tūdaliņ.lv">help@tūdaliņ.lv</a></p> diff --git a/t/docs-php-markdown-todo/Email_auto_links.text b/t/docs-php-markdown-todo/Email_auto_links.text new file mode 100644 index 0000000..a8af4ec --- /dev/null +++ b/t/docs-php-markdown-todo/Email_auto_links.text @@ -0,0 +1,3 @@ +<michel.fortin@michelf.com> + +International domain names: <help@tūdaliņ.lv>
\ No newline at end of file diff --git a/t/docs-php-markdown-todo/Emphasis.html b/t/docs-php-markdown-todo/Emphasis.html new file mode 100644 index 0000000..7399132 --- /dev/null +++ b/t/docs-php-markdown-todo/Emphasis.html @@ -0,0 +1,72 @@ +<p>Combined emphasis:</p> + +<ol> +<li><strong><em>test test</em></strong></li> +<li><strong><em>test test</em></strong></li> +<li><em>test <strong>test</strong></em></li> +<li><strong>test <em>test</em></strong></li> +<li><strong><em>test</em> test</strong></li> +<li><em><strong>test</strong> test</em></li> +<li><strong><em>test</em> test</strong></li> +<li><strong>test <em>test</em></strong></li> +<li><em>test <strong>test</strong></em></li> +<li><em>test <strong>test</strong></em></li> +<li><strong>test <em>test</em></strong></li> +<li><strong><em>test</em> test</strong></li> +<li><em><strong>test</strong> test</em></li> +<li><strong><em>test</em> test</strong></li> +<li><strong>test <em>test</em></strong></li> +<li><em>test <strong>test</strong></em></li> +</ol> + +<p>Incorrect nesting:</p> + +<ol> +<li>*test <strong>test* test</strong></li> +<li>_test <strong>test_ test</strong></li> +<li>**test <em>test</em>* test*</li> +<li>__test <em>test</em>_ test_</li> +<li><em>test *test</em> test*</li> +<li><em>test _test</em> test_</li> +<li><strong>test <strong>test</strong> test</strong></li> +<li><strong>test <strong>test</strong> test</strong></li> +</ol> + +<p>No emphasis:</p> + +<ol> +<li>test* test *test</li> +<li>test** test **test</li> +<li>test_ test _test</li> +<li>test__ test __test</li> +</ol> + +<p>Middle-word emphasis (asterisks):</p> + +<ol> +<li><em>a</em>b</li> +<li>a<em>b</em></li> +<li>a<em>b</em>c</li> +<li><strong>a</strong>b</li> +<li>a<strong>b</strong></li> +<li>a<strong>b</strong>c</li> +</ol> + +<p>Middle-word emphasis (underscore):</p> + +<ol> +<li><em>a</em>b</li> +<li>a<em>b</em></li> +<li>a<em>b</em>c</li> +<li><strong>a</strong>b</li> +<li>a<strong>b</strong></li> +<li>a<strong>b</strong>c</li> +</ol> + +<p>my<em>precious</em>file.txt</p> + +<h2>Tricky Cases</h2> + +<p>E**. <strong>Test</strong> TestTestTest</p> + +<p>E**. <strong>Test</strong> Test Test Test</p> diff --git a/t/docs-php-markdown-todo/Emphasis.text b/t/docs-php-markdown-todo/Emphasis.text new file mode 100644 index 0000000..ec48dec --- /dev/null +++ b/t/docs-php-markdown-todo/Emphasis.text @@ -0,0 +1,69 @@ +Combined emphasis: + +1. ***test test*** +2. ___test test___ +3. *test **test*** +4. **test *test*** +5. ***test* test** +6. ***test** test* +7. ***test* test** +8. **test *test*** +9. *test **test*** +10. _test __test___ +11. __test _test___ +12. ___test_ test__ +13. ___test__ test_ +14. ___test_ test__ +15. __test _test___ +16. _test __test___ + + +Incorrect nesting: + +1. *test **test* test** +2. _test __test_ test__ +3. **test *test** test* +4. __test _test__ test_ +5. *test *test* test* +6. _test _test_ test_ +7. **test **test** test** +8. __test __test__ test__ + + + +No emphasis: + +1. test* test *test +2. test** test **test +3. test_ test _test +4. test__ test __test + + + +Middle-word emphasis (asterisks): + +1. *a*b +2. a*b* +3. a*b*c +4. **a**b +5. a**b** +6. a**b**c + + +Middle-word emphasis (underscore): + +1. _a_b +2. a_b_ +3. a_b_c +4. __a__b +5. a__b__ +6. a__b__c + +my_precious_file.txt + + +## Tricky Cases + +E**. **Test** TestTestTest + +E**. **Test** Test Test Test diff --git a/t/docs-php-markdown-todo/Inline_HTML_(Span).html b/t/docs-php-markdown-todo/Inline_HTML_(Span).html new file mode 100644 index 0000000..4d18aff --- /dev/null +++ b/t/docs-php-markdown-todo/Inline_HTML_(Span).html @@ -0,0 +1,4 @@ +<p><abbr title="` **Attribute Content Is Not A Code Span** `">ACINACS</abbr></p> + +<p><abbr title="`first backtick!">SB</abbr> +<abbr title="`second backtick!">SB</abbr></p>
\ No newline at end of file diff --git a/t/docs-php-markdown-todo/Inline_HTML_(Span).text b/t/docs-php-markdown-todo/Inline_HTML_(Span).text new file mode 100644 index 0000000..19028bb --- /dev/null +++ b/t/docs-php-markdown-todo/Inline_HTML_(Span).text @@ -0,0 +1,4 @@ +<abbr title="` **Attribute Content Is Not A Code Span** `">ACINACS</abbr> + +<abbr title="`first backtick!">SB</abbr> +<abbr title="`second backtick!">SB</abbr>
\ No newline at end of file diff --git a/t/docs-php-markdown-todo/Ins_and_del.text b/t/docs-php-markdown-todo/Ins_and_del.text new file mode 100644 index 0000000..2d54c66 --- /dev/null +++ b/t/docs-php-markdown-todo/Ins_and_del.text @@ -0,0 +1,17 @@ +Here is a block tag ins: + +<ins> +<p>Some text</p> +</ins> + +<ins>And here it is inside a paragraph.</ins> + +And here it is <ins>in the middle of</ins> a paragraph. + +<del> +<p>Some text</p> +</del> + +<del>And here is ins as a paragraph.</del> + +And here it is <del>in the middle of</del> a paragraph. diff --git a/t/docs-php-markdown-todo/Ins_and_del.xhtml b/t/docs-php-markdown-todo/Ins_and_del.xhtml new file mode 100644 index 0000000..60e8c5f --- /dev/null +++ b/t/docs-php-markdown-todo/Ins_and_del.xhtml @@ -0,0 +1,17 @@ +<p>Here is a block tag ins:</p> + +<ins> +<p>Some text</p> +</ins> + +<p><ins>And here it is inside a paragraph.</ins></p> + +<p>And here it is <ins>in the middle of</ins> a paragraph.</p> + +<del> +<p>Some text</p> +</del> + +<p><del>And here is ins as a paragraph.</del></p> + +<p>And here it is <del>in the middle of</del> a paragraph.</p> diff --git a/t/docs-php-markdown-todo/Links_inline_style.html b/t/docs-php-markdown-todo/Links_inline_style.html new file mode 100644 index 0000000..d3e4d11 --- /dev/null +++ b/t/docs-php-markdown-todo/Links_inline_style.html @@ -0,0 +1 @@ +<p><a href="?}]*+|&)">silly URL w/ angle brackets</a>.</p> diff --git a/t/docs-php-markdown-todo/Links_inline_style.text b/t/docs-php-markdown-todo/Links_inline_style.text new file mode 100644 index 0000000..600a044 --- /dev/null +++ b/t/docs-php-markdown-todo/Links_inline_style.text @@ -0,0 +1 @@ +[silly URL w/ angle brackets](<?}]*+|&)>). diff --git a/t/docs-php-markdown-todo/Nesting.html b/t/docs-php-markdown-todo/Nesting.html new file mode 100644 index 0000000..37845d3 --- /dev/null +++ b/t/docs-php-markdown-todo/Nesting.html @@ -0,0 +1,11 @@ +<p>Valid nesting:</p> + +<p><strong><a href="url">Link</a></strong></p> + +<p><a href="url"><strong>Link</strong></a></p> + +<p><strong><a href="url"><strong>Link</strong></a></strong></p> + +<p>Invalid nesting:</p> + +<p><a href="url">[Link](url)</a></p> diff --git a/t/docs-php-markdown-todo/Nesting.text b/t/docs-php-markdown-todo/Nesting.text new file mode 100644 index 0000000..791538c --- /dev/null +++ b/t/docs-php-markdown-todo/Nesting.text @@ -0,0 +1,11 @@ +Valid nesting: + +**[Link](url)** + +[**Link**](url) + +**[**Link**](url)** + +Invalid nesting: + +[[Link](url)](url)
\ No newline at end of file diff --git a/t/docs-php-markdown-todo/Parens_in_URL.html b/t/docs-php-markdown-todo/Parens_in_URL.html new file mode 100644 index 0000000..a81aa02 --- /dev/null +++ b/t/docs-php-markdown-todo/Parens_in_URL.html @@ -0,0 +1,11 @@ +<p><a href="/url(test)" title="title">Inline link 1 with parens</a>.</p> + +<p><a href="/url(test)" title="title">Inline link 2 with parens</a>.</p> + +<p><a href="/url(test)" title="title">Inline link 3 with non-escaped parens</a>.</p> + +<p><a href="/url(test)" title="title">Inline link 4 with non-escaped parens</a>.</p> + +<p><a href="/url(test)" title="title">Reference link 1 with parens</a>.</p> + +<p><a href="/url(test)" title="title">Reference link 2 with parens</a>.</p>
\ No newline at end of file diff --git a/t/docs-php-markdown-todo/Parens_in_URL.text b/t/docs-php-markdown-todo/Parens_in_URL.text new file mode 100644 index 0000000..bb7be4f --- /dev/null +++ b/t/docs-php-markdown-todo/Parens_in_URL.text @@ -0,0 +1,14 @@ +[Inline link 1 with parens](/url\(test\) "title"). + +[Inline link 2 with parens](</url\(test\)> "title"). + +[Inline link 3 with non-escaped parens](/url(test) "title"). + +[Inline link 4 with non-escaped parens](</url(test)> "title"). + +[Reference link 1 with parens][1]. + +[Reference link 2 with parens][2]. + + [1]: /url(test) "title" + [2]: </url(test)> "title" diff --git a/t/docs-php-markdown/Backslash_escapes.html b/t/docs-php-markdown/Backslash_escapes.html new file mode 100644 index 0000000..c5dbcfc --- /dev/null +++ b/t/docs-php-markdown/Backslash_escapes.html @@ -0,0 +1,9 @@ +<p>Tricky combinaisons:</p> + +<p>backslash with \-- two dashes</p> + +<p>backslash with \> greater than</p> + +<p>\[test](not a link)</p> + +<p>\*no emphasis*</p> diff --git a/t/docs-php-markdown/Backslash_escapes.text b/t/docs-php-markdown/Backslash_escapes.text new file mode 100644 index 0000000..a5e769b --- /dev/null +++ b/t/docs-php-markdown/Backslash_escapes.text @@ -0,0 +1 @@ +Tricky combinaisons:
backslash with \\-- two dashes
backslash with \\> greater than
\\\[test](not a link)
\\\*no emphasis*
\ No newline at end of file diff --git a/t/docs-php-markdown/Code_Spans.html b/t/docs-php-markdown/Code_Spans.html new file mode 100644 index 0000000..9ed0df8 --- /dev/null +++ b/t/docs-php-markdown/Code_Spans.html @@ -0,0 +1,6 @@ +<p>From <code><!--</code> to <code>--></code> +on two lines.</p> + +<p>From <code><!--</code> +to <code>--></code> +on three lines.</p> diff --git a/t/docs-php-markdown/Code_Spans.text b/t/docs-php-markdown/Code_Spans.text new file mode 100644 index 0000000..43f2bcf --- /dev/null +++ b/t/docs-php-markdown/Code_Spans.text @@ -0,0 +1,6 @@ +From `<!--` to `-->` +on two lines. + +From `<!--` +to `-->` +on three lines. diff --git a/t/docs-php-markdown/Code_block_in_a_list_item.html b/t/docs-php-markdown/Code_block_in_a_list_item.html new file mode 100644 index 0000000..8ac5d83 --- /dev/null +++ b/t/docs-php-markdown/Code_block_in_a_list_item.html @@ -0,0 +1,11 @@ +<ul> +<li><p>List Item:</p> + +<pre><code>code block + + +with a blank line +</code></pre> + +<p>within a list item.</p></li> +</ul>
\ No newline at end of file diff --git a/t/docs-php-markdown/Code_block_in_a_list_item.text b/t/docs-php-markdown/Code_block_in_a_list_item.text new file mode 100644 index 0000000..3fa24c3 --- /dev/null +++ b/t/docs-php-markdown/Code_block_in_a_list_item.text @@ -0,0 +1,8 @@ + +* List Item: + + code block + + with a blank line + + within a list item.
\ No newline at end of file diff --git a/t/docs-php-markdown/Headers.html b/t/docs-php-markdown/Headers.html new file mode 100644 index 0000000..3adb470 --- /dev/null +++ b/t/docs-php-markdown/Headers.html @@ -0,0 +1,39 @@ +<h1>Header</h1> + +<h2>Header</h2> + +<h3>Header</h3> + +<hr /> + +<h1>Header</h1> + +<p>Paragraph</p> + +<h2>Header</h2> + +<p>Paragraph</p> + +<h3>Header</h3> + +<p>Paragraph</p> + +<hr /> + +<p>Paragraph</p> + +<h1>Header</h1> + +<p>Paragraph</p> + +<p>Paragraph</p> + +<h2>Header</h2> + +<p>Paragraph</p> + +<p>Paragraph</p> + +<h3>Header</h3> + +<p>Paragraph</p> diff --git a/t/docs-php-markdown/Headers.text b/t/docs-php-markdown/Headers.text new file mode 100644 index 0000000..3a39174 --- /dev/null +++ b/t/docs-php-markdown/Headers.text @@ -0,0 +1,9 @@ +Header
======
Header
------
### Header + + - - - + +Header
======
Paragraph
Header
------
Paragraph
### Header
Paragraph + + - - - + +Paragraph
Header
======
Paragraph
Paragraph
Header
------
Paragraph
Paragraph
### Header
Paragraph
\ No newline at end of file diff --git a/t/docs-php-markdown/Images_(Untitled).html b/t/docs-php-markdown/Images_(Untitled).html new file mode 100644 index 0000000..1b9bc04 --- /dev/null +++ b/t/docs-php-markdown/Images_(Untitled).html @@ -0,0 +1,5 @@ +<p><img src="/url/" alt="alt text" /></p> + +<p><img src="/url/" alt="alt text" /></p> + +<p><img src="/url/" alt="alt text" /></p> diff --git a/t/docs-php-markdown/Images_(Untitled).text b/t/docs-php-markdown/Images_(Untitled).text new file mode 100644 index 0000000..cb481de --- /dev/null +++ b/t/docs-php-markdown/Images_(Untitled).text @@ -0,0 +1,7 @@ + + + + +![alt text][foo] + + [foo]: /url/
\ No newline at end of file diff --git a/t/docs-php-markdown/Inline_HTML_(Simple).html b/t/docs-php-markdown/Inline_HTML_(Simple).html new file mode 100644 index 0000000..facfefb --- /dev/null +++ b/t/docs-php-markdown/Inline_HTML_(Simple).html @@ -0,0 +1,15 @@ +<p>With some attributes:</p> + +<div id="test"> + foo +</div> + +<div id="test" + class="nono"> + foo +</div> + +<p>Hr's:</p> + +<hr class="foo" + id="bar" >
\ No newline at end of file diff --git a/t/docs-php-markdown/Inline_HTML_(Simple).text b/t/docs-php-markdown/Inline_HTML_(Simple).text new file mode 100644 index 0000000..9177105 --- /dev/null +++ b/t/docs-php-markdown/Inline_HTML_(Simple).text @@ -0,0 +1,15 @@ +With some attributes: + +<div id="test"> + foo +</div> + +<div id="test" + class="nono"> + foo +</div> + +Hr's: + +<hr class="foo" + id="bar" > diff --git a/t/docs-php-markdown/Inline_HTML_comments.html b/t/docs-php-markdown/Inline_HTML_comments.html new file mode 100644 index 0000000..b45f014 --- /dev/null +++ b/t/docs-php-markdown/Inline_HTML_comments.html @@ -0,0 +1,9 @@ +<p>Paragraph one.</p> + +<!-- double--dash (invalid SGML comment) --> + +<p>Paragraph two.</p> + +<!-- enclosed tag </div> --> + +<p>The end.</p> diff --git a/t/docs-php-markdown/Inline_HTML_comments.text b/t/docs-php-markdown/Inline_HTML_comments.text new file mode 100644 index 0000000..d57d00a --- /dev/null +++ b/t/docs-php-markdown/Inline_HTML_comments.text @@ -0,0 +1,9 @@ +Paragraph one. + +<!-- double--dash (invalid SGML comment) --> + +Paragraph two. + +<!-- enclosed tag </div> --> + +The end. diff --git a/t/docs-php-markdown/PHP-Specific_Bugs.html b/t/docs-php-markdown/PHP-Specific_Bugs.html new file mode 100644 index 0000000..c982417 --- /dev/null +++ b/t/docs-php-markdown/PHP-Specific_Bugs.html @@ -0,0 +1,17 @@ +<p>This tests for a bug where quotes escaped by PHP when using +<code>preg_replace</code> with the <code>/e</code> modifier must be correctly unescaped +(hence the <code>_UnslashQuotes</code> function found only in PHP Markdown).</p> + +<p>Headers below should appear exactly as they are typed (no backslash +added or removed).</p> + +<h1>Header "quoted\" again \""</h1> + +<h2>Header "quoted\" again \""</h2> + +<h3>Header "quoted\" again \""</h3> + +<p>Test with tabs for <code>_Detab</code>:</p> + +<pre><code>Code 'block' with some "tabs" and "quotes" +</code></pre> diff --git a/t/docs-php-markdown/PHP-Specific_Bugs.text b/t/docs-php-markdown/PHP-Specific_Bugs.text new file mode 100644 index 0000000..246b60d --- /dev/null +++ b/t/docs-php-markdown/PHP-Specific_Bugs.text @@ -0,0 +1,22 @@ +This tests for a bug where quotes escaped by PHP when using +`preg_replace` with the `/e` modifier must be correctly unescaped +(hence the `_UnslashQuotes` function found only in PHP Markdown). + + + +Headers below should appear exactly as they are typed (no backslash +added or removed). + +Header "quoted\" again \\"" +=========================== + +Header "quoted\" again \\"" +--------------------------- + +### Header "quoted\" again \\"" ### + + + +Test with tabs for `_Detab`: + + Code 'block' with some "tabs" and "quotes" diff --git a/t/docs-php-markdown/Tight_blocks.html b/t/docs-php-markdown/Tight_blocks.html new file mode 100644 index 0000000..8655430 --- /dev/null +++ b/t/docs-php-markdown/Tight_blocks.html @@ -0,0 +1,21 @@ +<p>Paragraph and no space: +* ciao</p> + +<p>Paragraph and 1 space: + * ciao</p> + +<p>Paragraph and 3 spaces: + * ciao</p> + +<p>Paragraph and 4 spaces: + * ciao</p> + +<p>Paragraph before header:</p> + +<h1>Header</h1> + +<p>Paragraph before blockquote:</p> + +<blockquote> + <p>Some quote.</p> +</blockquote> diff --git a/t/docs-php-markdown/Tight_blocks.text b/t/docs-php-markdown/Tight_blocks.text new file mode 100644 index 0000000..ae4cdcb --- /dev/null +++ b/t/docs-php-markdown/Tight_blocks.text @@ -0,0 +1 @@ +Paragraph and no space:
* ciao
Paragraph and 1 space:
* ciao
Paragraph and 3 spaces:
* ciao
Paragraph and 4 spaces:
* ciao
Paragraph before header:
#Header
Paragraph before blockquote:
>Some quote.
\ No newline at end of file diff --git a/t/docs-pythonmarkdown2-tm-cases-pass/auto_link.html b/t/docs-pythonmarkdown2-tm-cases-pass/auto_link.html new file mode 100644 index 0000000..e4dde05 --- /dev/null +++ b/t/docs-pythonmarkdown2-tm-cases-pass/auto_link.html @@ -0,0 +1,3 @@ +<p>I can has autolink? <a href="http://icanhascheeseburger.com">http://icanhascheeseburger.com</a></p> + +<p>Ask garfield: <a href="mailto:garfield@example.com">garfield@example.com</a></p> diff --git a/t/docs-pythonmarkdown2-tm-cases-pass/auto_link.text b/t/docs-pythonmarkdown2-tm-cases-pass/auto_link.text new file mode 100644 index 0000000..e5354cd --- /dev/null +++ b/t/docs-pythonmarkdown2-tm-cases-pass/auto_link.text @@ -0,0 +1,3 @@ +I can has autolink? <http://icanhascheeseburger.com> + +Ask garfield: <garfield@example.com> diff --git a/t/docs-pythonmarkdown2-tm-cases-pass/auto_link_safe_mode.html b/t/docs-pythonmarkdown2-tm-cases-pass/auto_link_safe_mode.html new file mode 100644 index 0000000..e4dde05 --- /dev/null +++ b/t/docs-pythonmarkdown2-tm-cases-pass/auto_link_safe_mode.html @@ -0,0 +1,3 @@ +<p>I can has autolink? <a href="http://icanhascheeseburger.com">http://icanhascheeseburger.com</a></p> + +<p>Ask garfield: <a href="mailto:garfield@example.com">garfield@example.com</a></p> diff --git a/t/docs-pythonmarkdown2-tm-cases-pass/auto_link_safe_mode.opts b/t/docs-pythonmarkdown2-tm-cases-pass/auto_link_safe_mode.opts new file mode 100644 index 0000000..ccb6a09 --- /dev/null +++ b/t/docs-pythonmarkdown2-tm-cases-pass/auto_link_safe_mode.opts @@ -0,0 +1 @@ +{'safe_mode': True} diff --git a/t/docs-pythonmarkdown2-tm-cases-pass/auto_link_safe_mode.text b/t/docs-pythonmarkdown2-tm-cases-pass/auto_link_safe_mode.text new file mode 100644 index 0000000..e5354cd --- /dev/null +++ b/t/docs-pythonmarkdown2-tm-cases-pass/auto_link_safe_mode.text @@ -0,0 +1,3 @@ +I can has autolink? <http://icanhascheeseburger.com> + +Ask garfield: <garfield@example.com> diff --git a/t/docs-pythonmarkdown2-tm-cases-pass/basic_safe_mode.html b/t/docs-pythonmarkdown2-tm-cases-pass/basic_safe_mode.html new file mode 100644 index 0000000..393e9d2 --- /dev/null +++ b/t/docs-pythonmarkdown2-tm-cases-pass/basic_safe_mode.html @@ -0,0 +1,5 @@ +<p>blah [HTML_REMOVED] blah</p> + +<p>[HTML_REMOVED]yowzer![HTML_REMOVED]</p> + +<p>blah</p> diff --git a/t/docs-pythonmarkdown2-tm-cases-pass/basic_safe_mode.opts b/t/docs-pythonmarkdown2-tm-cases-pass/basic_safe_mode.opts new file mode 100644 index 0000000..e74c7cc --- /dev/null +++ b/t/docs-pythonmarkdown2-tm-cases-pass/basic_safe_mode.opts @@ -0,0 +1,2 @@ +# Use the old (for-compat-only) way of specifying "replace" safe mode. +{"safe_mode": True} diff --git a/t/docs-pythonmarkdown2-tm-cases-pass/basic_safe_mode.text b/t/docs-pythonmarkdown2-tm-cases-pass/basic_safe_mode.text new file mode 100644 index 0000000..ee04231 --- /dev/null +++ b/t/docs-pythonmarkdown2-tm-cases-pass/basic_safe_mode.text @@ -0,0 +1,5 @@ +blah <img src="dangerous"> blah + +<div>yowzer!</div> + +blah diff --git a/t/docs-pythonmarkdown2-tm-cases-pass/basic_safe_mode_escape.html b/t/docs-pythonmarkdown2-tm-cases-pass/basic_safe_mode_escape.html new file mode 100644 index 0000000..af24510 --- /dev/null +++ b/t/docs-pythonmarkdown2-tm-cases-pass/basic_safe_mode_escape.html @@ -0,0 +1,5 @@ +<p>blah <img src="dangerous"> blah</p> + +<p><div>yowzer!</div></p> + +<p>blah</p> diff --git a/t/docs-pythonmarkdown2-tm-cases-pass/basic_safe_mode_escape.opts b/t/docs-pythonmarkdown2-tm-cases-pass/basic_safe_mode_escape.opts new file mode 100644 index 0000000..ad487c0 --- /dev/null +++ b/t/docs-pythonmarkdown2-tm-cases-pass/basic_safe_mode_escape.opts @@ -0,0 +1 @@ +{"safe_mode": "escape"} diff --git a/t/docs-pythonmarkdown2-tm-cases-pass/basic_safe_mode_escape.text b/t/docs-pythonmarkdown2-tm-cases-pass/basic_safe_mode_escape.text new file mode 100644 index 0000000..ee04231 --- /dev/null +++ b/t/docs-pythonmarkdown2-tm-cases-pass/basic_safe_mode_escape.text @@ -0,0 +1,5 @@ +blah <img src="dangerous"> blah + +<div>yowzer!</div> + +blah diff --git a/t/docs-pythonmarkdown2-tm-cases-pass/blockquote.html b/t/docs-pythonmarkdown2-tm-cases-pass/blockquote.html new file mode 100644 index 0000000..5cde1cb --- /dev/null +++ b/t/docs-pythonmarkdown2-tm-cases-pass/blockquote.html @@ -0,0 +1,11 @@ +<p>[Trent wrote]</p> + +<blockquote> + <p>no way</p> +</blockquote> + +<p>[Jeff wrote]</p> + +<blockquote> + <p>way</p> +</blockquote> diff --git a/t/docs-pythonmarkdown2-tm-cases-pass/blockquote.text b/t/docs-pythonmarkdown2-tm-cases-pass/blockquote.text new file mode 100644 index 0000000..3bcecaa --- /dev/null +++ b/t/docs-pythonmarkdown2-tm-cases-pass/blockquote.text @@ -0,0 +1,5 @@ +[Trent wrote] +> no way + +[Jeff wrote] +> way diff --git a/t/docs-pythonmarkdown2-tm-cases-pass/blockquote_with_pre.html b/t/docs-pythonmarkdown2-tm-cases-pass/blockquote_with_pre.html new file mode 100644 index 0000000..d03cc78 --- /dev/null +++ b/t/docs-pythonmarkdown2-tm-cases-pass/blockquote_with_pre.html @@ -0,0 +1,9 @@ +<blockquote> + <p>Markdown indents blockquotes a couple of spaces + necessitating some tweaks for pre-blocks in that + blockquote:</p> + +<pre><code>here is a check +for that +</code></pre> +</blockquote> diff --git a/t/docs-pythonmarkdown2-tm-cases-pass/blockquote_with_pre.text b/t/docs-pythonmarkdown2-tm-cases-pass/blockquote_with_pre.text new file mode 100644 index 0000000..e61b82f --- /dev/null +++ b/t/docs-pythonmarkdown2-tm-cases-pass/blockquote_with_pre.text @@ -0,0 +1,6 @@ +> Markdown indents blockquotes a couple of spaces +> necessitating some tweaks for pre-blocks in that +> blockquote: +> +> here is a check +> for that diff --git a/t/docs-pythonmarkdown2-tm-cases-pass/code_block_with_tabs.html b/t/docs-pythonmarkdown2-tm-cases-pass/code_block_with_tabs.html new file mode 100644 index 0000000..6c32e46 --- /dev/null +++ b/t/docs-pythonmarkdown2-tm-cases-pass/code_block_with_tabs.html @@ -0,0 +1,4 @@ +<p>Test with tabs for <code>_Detab</code>:</p> + +<pre><code>Code 'block' with some "tabs" and "quotes" +</code></pre> diff --git a/t/docs-pythonmarkdown2-tm-cases-pass/code_block_with_tabs.text b/t/docs-pythonmarkdown2-tm-cases-pass/code_block_with_tabs.text new file mode 100644 index 0000000..bcf94c4 --- /dev/null +++ b/t/docs-pythonmarkdown2-tm-cases-pass/code_block_with_tabs.text @@ -0,0 +1,3 @@ +Test with tabs for `_Detab`: + + Code 'block' with some "tabs" and "quotes" diff --git a/t/docs-pythonmarkdown2-tm-cases-pass/code_safe_emphasis.html b/t/docs-pythonmarkdown2-tm-cases-pass/code_safe_emphasis.html new file mode 100644 index 0000000..f53e6a5 --- /dev/null +++ b/t/docs-pythonmarkdown2-tm-cases-pass/code_safe_emphasis.html @@ -0,0 +1,2 @@ +<p>This is <em>italic</em> and this is <strong>bold</strong>. +This is NOT _italic_ and this is __bold__ because --code-safe is turned on.</p> diff --git a/t/docs-pythonmarkdown2-tm-cases-pass/code_safe_emphasis.opts b/t/docs-pythonmarkdown2-tm-cases-pass/code_safe_emphasis.opts new file mode 100644 index 0000000..cd0b9d6 --- /dev/null +++ b/t/docs-pythonmarkdown2-tm-cases-pass/code_safe_emphasis.opts @@ -0,0 +1 @@ +{"extras": ["code-friendly"]} diff --git a/t/docs-pythonmarkdown2-tm-cases-pass/code_safe_emphasis.text b/t/docs-pythonmarkdown2-tm-cases-pass/code_safe_emphasis.text new file mode 100644 index 0000000..6e9df74 --- /dev/null +++ b/t/docs-pythonmarkdown2-tm-cases-pass/code_safe_emphasis.text @@ -0,0 +1,2 @@ +This is *italic* and this is **bold**.
+This is NOT _italic_ and this is __bold__ because --code-safe is turned on.
diff --git a/t/docs-pythonmarkdown2-tm-cases-pass/codeblock.html b/t/docs-pythonmarkdown2-tm-cases-pass/codeblock.html new file mode 100644 index 0000000..bf7f5c2 --- /dev/null +++ b/t/docs-pythonmarkdown2-tm-cases-pass/codeblock.html @@ -0,0 +1,8 @@ +<pre><code>some code +</code></pre> + +<p>some 'splaining</p> + +<pre><code>some more code +2 > 1 +</code></pre> diff --git a/t/docs-pythonmarkdown2-tm-cases-pass/codeblock.text b/t/docs-pythonmarkdown2-tm-cases-pass/codeblock.text new file mode 100644 index 0000000..d374216 --- /dev/null +++ b/t/docs-pythonmarkdown2-tm-cases-pass/codeblock.text @@ -0,0 +1,7 @@ + some code + +some 'splaining + + some more code + 2 > 1 + diff --git a/t/docs-pythonmarkdown2-tm-cases-pass/codespans.html b/t/docs-pythonmarkdown2-tm-cases-pass/codespans.html new file mode 100644 index 0000000..3528bcd --- /dev/null +++ b/t/docs-pythonmarkdown2-tm-cases-pass/codespans.html @@ -0,0 +1,2 @@ +<p><code>This</code> is a code span. +And <code>This is one with an `embedded backtick`</code>.</p> diff --git a/t/docs-pythonmarkdown2-tm-cases-pass/codespans.text b/t/docs-pythonmarkdown2-tm-cases-pass/codespans.text new file mode 100644 index 0000000..67015a9 --- /dev/null +++ b/t/docs-pythonmarkdown2-tm-cases-pass/codespans.text @@ -0,0 +1,2 @@ +`This` is a code span. +And ``This is one with an `embedded backtick` ``. diff --git a/t/docs-pythonmarkdown2-tm-cases-pass/codespans_safe_mode.html b/t/docs-pythonmarkdown2-tm-cases-pass/codespans_safe_mode.html new file mode 100644 index 0000000..3528bcd --- /dev/null +++ b/t/docs-pythonmarkdown2-tm-cases-pass/codespans_safe_mode.html @@ -0,0 +1,2 @@ +<p><code>This</code> is a code span. +And <code>This is one with an `embedded backtick`</code>.</p> diff --git a/t/docs-pythonmarkdown2-tm-cases-pass/codespans_safe_mode.opts b/t/docs-pythonmarkdown2-tm-cases-pass/codespans_safe_mode.opts new file mode 100644 index 0000000..ccb6a09 --- /dev/null +++ b/t/docs-pythonmarkdown2-tm-cases-pass/codespans_safe_mode.opts @@ -0,0 +1 @@ +{'safe_mode': True} diff --git a/t/docs-pythonmarkdown2-tm-cases-pass/codespans_safe_mode.text b/t/docs-pythonmarkdown2-tm-cases-pass/codespans_safe_mode.text new file mode 100644 index 0000000..67015a9 --- /dev/null +++ b/t/docs-pythonmarkdown2-tm-cases-pass/codespans_safe_mode.text @@ -0,0 +1,2 @@ +`This` is a code span. +And ``This is one with an `embedded backtick` ``. diff --git a/t/docs-pythonmarkdown2-tm-cases-pass/emacs_head_vars.html b/t/docs-pythonmarkdown2-tm-cases-pass/emacs_head_vars.html new file mode 100644 index 0000000..b194eb9 --- /dev/null +++ b/t/docs-pythonmarkdown2-tm-cases-pass/emacs_head_vars.html @@ -0,0 +1,4 @@ +<!-- -*- markdown-extras: code-friendly -*- --> + +<p>This sentence talks about the Python __init__ method, which I'd rather not be +interpreted as Markdown's strong.</p> diff --git a/t/docs-pythonmarkdown2-tm-cases-pass/emacs_head_vars.text b/t/docs-pythonmarkdown2-tm-cases-pass/emacs_head_vars.text new file mode 100644 index 0000000..2d05ab8 --- /dev/null +++ b/t/docs-pythonmarkdown2-tm-cases-pass/emacs_head_vars.text @@ -0,0 +1,4 @@ +<!-- -*- markdown-extras: code-friendly -*- --> + +This sentence talks about the Python __init__ method, which I'd rather not be +interpreted as Markdown's strong. diff --git a/t/docs-pythonmarkdown2-tm-cases-pass/emacs_tail_vars.html b/t/docs-pythonmarkdown2-tm-cases-pass/emacs_tail_vars.html new file mode 100644 index 0000000..8b47011 --- /dev/null +++ b/t/docs-pythonmarkdown2-tm-cases-pass/emacs_tail_vars.html @@ -0,0 +1,8 @@ +<p>This sentence talks about the Python __init__ method, which I'd rather not be +interpreted as Markdown's strong.</p> + +<!-- + Local Variables: + markdown-extras: code-friendly + End: + --> diff --git a/t/docs-pythonmarkdown2-tm-cases-pass/emacs_tail_vars.text b/t/docs-pythonmarkdown2-tm-cases-pass/emacs_tail_vars.text new file mode 100644 index 0000000..400d2eb --- /dev/null +++ b/t/docs-pythonmarkdown2-tm-cases-pass/emacs_tail_vars.text @@ -0,0 +1,8 @@ +This sentence talks about the Python __init__ method, which I'd rather not be +interpreted as Markdown's strong. + +<!-- + Local Variables: + markdown-extras: code-friendly + End: + --> diff --git a/t/docs-pythonmarkdown2-tm-cases-pass/emphasis.html b/t/docs-pythonmarkdown2-tm-cases-pass/emphasis.html new file mode 100644 index 0000000..a850dc9 --- /dev/null +++ b/t/docs-pythonmarkdown2-tm-cases-pass/emphasis.html @@ -0,0 +1,2 @@ +<p>This is <em>italic</em> and this is <strong>bold</strong>. +This is also <em>italic</em> and this is <strong>bold</strong>.</p> diff --git a/t/docs-pythonmarkdown2-tm-cases-pass/emphasis.text b/t/docs-pythonmarkdown2-tm-cases-pass/emphasis.text new file mode 100644 index 0000000..99c324e --- /dev/null +++ b/t/docs-pythonmarkdown2-tm-cases-pass/emphasis.text @@ -0,0 +1,2 @@ +This is *italic* and this is **bold**.
+This is also _italic_ and this is __bold__.
diff --git a/t/docs-pythonmarkdown2-tm-cases-pass/escapes.html b/t/docs-pythonmarkdown2-tm-cases-pass/escapes.html new file mode 100644 index 0000000..9670548 --- /dev/null +++ b/t/docs-pythonmarkdown2-tm-cases-pass/escapes.html @@ -0,0 +1,3 @@ +<p>**don't shout**</p> + +<p>*don't emphasize*</p> diff --git a/t/docs-pythonmarkdown2-tm-cases-pass/escapes.text b/t/docs-pythonmarkdown2-tm-cases-pass/escapes.text new file mode 100644 index 0000000..a79164e --- /dev/null +++ b/t/docs-pythonmarkdown2-tm-cases-pass/escapes.text @@ -0,0 +1,3 @@ +\*\*don't shout\*\* + +\*don't emphasize\* diff --git a/t/docs-pythonmarkdown2-tm-cases-pass/footnotes.html b/t/docs-pythonmarkdown2-tm-cases-pass/footnotes.html new file mode 100644 index 0000000..37c6d8b --- /dev/null +++ b/t/docs-pythonmarkdown2-tm-cases-pass/footnotes.html @@ -0,0 +1,27 @@ +<p>This is a para with a footnote.<sup class="footnote-ref" id="fnref-1"><a href="#fn-1">1</a></sup></p> + +<p>This is another para with a footnote<sup class="footnote-ref" id="fnref-2"><a href="#fn-2">2</a></sup> in it. Actually it has two<sup class="footnote-ref" id="fnref-3"><a href="#fn-3">3</a></sup> of +them. No, three<sup class="footnote-ref" id="fnref-4"><a href="#fn-4">4</a></sup>.</p> + +<div class="footnotes"> +<hr /> +<ol> +<li id="fn-1"> +<p>Here is the body of the first footnote. <a href="#fnref-1" class="footnoteBackLink" title="Jump back to footnote 1 in the text.">↩</a></p> +</li> + +<li id="fn-2"> +<p>And of the second footnote.</p> + +<p>This one has multiple paragraphs. <a href="#fnref-2" class="footnoteBackLink" title="Jump back to footnote 2 in the text.">↩</a></p> +</li> + +<li id="fn-3"> +<p>Here is a footnote body that starts on next line. <a href="#fnref-3" class="footnoteBackLink" title="Jump back to footnote 3 in the text.">↩</a></p> +</li> + +<li id="fn-4"> +<p>quickie "that looks like a link ref if not careful" <a href="#fnref-4" class="footnoteBackLink" title="Jump back to footnote 4 in the text.">↩</a></p> +</li> +</ol> +</div> diff --git a/t/docs-pythonmarkdown2-tm-cases-pass/footnotes.opts b/t/docs-pythonmarkdown2-tm-cases-pass/footnotes.opts new file mode 100644 index 0000000..9dfee9e --- /dev/null +++ b/t/docs-pythonmarkdown2-tm-cases-pass/footnotes.opts @@ -0,0 +1 @@ +{"extras": ["footnotes"]} diff --git a/t/docs-pythonmarkdown2-tm-cases-pass/footnotes.text b/t/docs-pythonmarkdown2-tm-cases-pass/footnotes.text new file mode 100644 index 0000000..7d6e716 --- /dev/null +++ b/t/docs-pythonmarkdown2-tm-cases-pass/footnotes.text @@ -0,0 +1,18 @@ +This is a para with a footnote.[^1] + +This is another para with a footnote[^2] in it. Actually it has two[^3] of +them. No, three[^4]. + + +[^1]: Here is the body of the first footnote. + +[^2]: And of the second footnote. + + This one has multiple paragraphs. + +[^3]: + Here is a footnote body that starts on next line. + +[^4]: quickie "that looks like a link ref if not careful" + + diff --git a/t/docs-pythonmarkdown2-tm-cases-pass/footnotes_letters.html b/t/docs-pythonmarkdown2-tm-cases-pass/footnotes_letters.html new file mode 100644 index 0000000..3702606 --- /dev/null +++ b/t/docs-pythonmarkdown2-tm-cases-pass/footnotes_letters.html @@ -0,0 +1,23 @@ +<p>This is a para with a footnote.<sup class="footnote-ref" id="fnref-foo"><a href="#fn-foo">1</a></sup></p> + +<p>This is another para with a footnote<sup class="footnote-ref" id="fnref-hyphen-ated"><a href="#fn-hyphen-ated">2</a></sup> in it. Actually it has two<sup class="footnote-ref" id="fnref-Capital"><a href="#fn-Capital">3</a></sup> of +them.</p> + +<div class="footnotes"> +<hr /> +<ol> +<li id="fn-foo"> +<p>Here is the body of the first footnote. <a href="#fnref-foo" class="footnoteBackLink" title="Jump back to footnote 1 in the text.">↩</a></p> +</li> + +<li id="fn-hyphen-ated"> +<p>And of the second footnote.</p> + +<p>This one has multiple paragraphs. <a href="#fnref-hyphen-ated" class="footnoteBackLink" title="Jump back to footnote 2 in the text.">↩</a></p> +</li> + +<li id="fn-Capital"> +<p>Here is a footnote body that starts on next line. <a href="#fnref-Capital" class="footnoteBackLink" title="Jump back to footnote 3 in the text.">↩</a></p> +</li> +</ol> +</div> diff --git a/t/docs-pythonmarkdown2-tm-cases-pass/footnotes_letters.opts b/t/docs-pythonmarkdown2-tm-cases-pass/footnotes_letters.opts new file mode 100644 index 0000000..9dfee9e --- /dev/null +++ b/t/docs-pythonmarkdown2-tm-cases-pass/footnotes_letters.opts @@ -0,0 +1 @@ +{"extras": ["footnotes"]} diff --git a/t/docs-pythonmarkdown2-tm-cases-pass/footnotes_letters.text b/t/docs-pythonmarkdown2-tm-cases-pass/footnotes_letters.text new file mode 100644 index 0000000..431a96b --- /dev/null +++ b/t/docs-pythonmarkdown2-tm-cases-pass/footnotes_letters.text @@ -0,0 +1,15 @@ +This is a para with a footnote.[^foo] + +This is another para with a footnote[^hyphen-ated] in it. Actually it has two[^Capital] of +them. + + +[^foo]: Here is the body of the first footnote. + +[^hyphen-ated]: And of the second footnote. + + This one has multiple paragraphs. + +[^Capital]: + Here is a footnote body that starts on next line. + diff --git a/t/docs-pythonmarkdown2-tm-cases-pass/footnotes_markup.html b/t/docs-pythonmarkdown2-tm-cases-pass/footnotes_markup.html new file mode 100644 index 0000000..f365041 --- /dev/null +++ b/t/docs-pythonmarkdown2-tm-cases-pass/footnotes_markup.html @@ -0,0 +1,22 @@ +<p>This is a para with a footnote.<sup class="footnote-ref" id="fnref-1"><a href="#fn-1">1</a></sup></p> + +<p>This is another para with a footnote.<sup class="footnote-ref" id="fnref-2"><a href="#fn-2">2</a></sup></p> + +<div class="footnotes"> +<hr /> +<ol> +<li id="fn-1"> +<p>And the <strong>body</strong> of the footnote has <code>markup</code>. For example, +a <a href="http://digg.com">link to digg</a>. And some code:</p> + +<pre><code>print "Hello, World!" +</code></pre> + +<p><a href="#fnref-1" class="footnoteBackLink" title="Jump back to footnote 1 in the text.">↩</a></p> +</li> + +<li id="fn-2"> +<p>This body has markup too, <em>but</em> doesn't end with a code block. <a href="#fnref-2" class="footnoteBackLink" title="Jump back to footnote 2 in the text.">↩</a></p> +</li> +</ol> +</div> diff --git a/t/docs-pythonmarkdown2-tm-cases-pass/footnotes_markup.opts b/t/docs-pythonmarkdown2-tm-cases-pass/footnotes_markup.opts new file mode 100644 index 0000000..9dfee9e --- /dev/null +++ b/t/docs-pythonmarkdown2-tm-cases-pass/footnotes_markup.opts @@ -0,0 +1 @@ +{"extras": ["footnotes"]} diff --git a/t/docs-pythonmarkdown2-tm-cases-pass/footnotes_markup.text b/t/docs-pythonmarkdown2-tm-cases-pass/footnotes_markup.text new file mode 100644 index 0000000..07b5922 --- /dev/null +++ b/t/docs-pythonmarkdown2-tm-cases-pass/footnotes_markup.text @@ -0,0 +1,10 @@ +This is a para with a footnote.[^1] + +This is another para with a footnote.[^2] + +[^1]: And the **body** of the footnote has `markup`. For example, + a [link to digg](http://digg.com). And some code: + + print "Hello, World!" + +[^2]: This body has markup too, *but* doesn't end with a code block. diff --git a/t/docs-pythonmarkdown2-tm-cases-pass/footnotes_safe_mode_escape.html b/t/docs-pythonmarkdown2-tm-cases-pass/footnotes_safe_mode_escape.html new file mode 100644 index 0000000..6bce5a7 --- /dev/null +++ b/t/docs-pythonmarkdown2-tm-cases-pass/footnotes_safe_mode_escape.html @@ -0,0 +1,12 @@ +<p>This is a para with a footnote.<sup class="footnote-ref" id="fnref-1"><a href="#fn-1">1</a></sup></p> + +<div class="footnotes"> +<hr /> +<ol> +<li id="fn-1"> +<p>Here is the <em>body</em> of <span class="yo">the</span> footnote.</p> + +<p><div class="blah">And here is the second para of the footnote.</div> <a href="#fnref-1" class="footnoteBackLink" title="Jump back to footnote 1 in the text.">↩</a></p> +</li> +</ol> +</div> diff --git a/t/docs-pythonmarkdown2-tm-cases-pass/footnotes_safe_mode_escape.opts b/t/docs-pythonmarkdown2-tm-cases-pass/footnotes_safe_mode_escape.opts new file mode 100644 index 0000000..9d97404 --- /dev/null +++ b/t/docs-pythonmarkdown2-tm-cases-pass/footnotes_safe_mode_escape.opts @@ -0,0 +1 @@ +{"safe_mode": "escape", "extras": ["footnotes"]} diff --git a/t/docs-pythonmarkdown2-tm-cases-pass/footnotes_safe_mode_escape.text b/t/docs-pythonmarkdown2-tm-cases-pass/footnotes_safe_mode_escape.text new file mode 100644 index 0000000..ae8e4e7 --- /dev/null +++ b/t/docs-pythonmarkdown2-tm-cases-pass/footnotes_safe_mode_escape.text @@ -0,0 +1,6 @@ +This is a para with a footnote.[^1] + +[^1]: Here is the <em>body</em> of <span class="yo">the</span> footnote. + + <div class="blah">And here is the second para of the footnote.</div> + diff --git a/t/docs-pythonmarkdown2-tm-cases-pass/header.html b/t/docs-pythonmarkdown2-tm-cases-pass/header.html new file mode 100644 index 0000000..90fc68a --- /dev/null +++ b/t/docs-pythonmarkdown2-tm-cases-pass/header.html @@ -0,0 +1,7 @@ +<h1>an h1</h1> + +<h2>an h2</h2> + +<h1>another h1</h1> + +<h2>another h2</h2> diff --git a/t/docs-pythonmarkdown2-tm-cases-pass/header.text b/t/docs-pythonmarkdown2-tm-cases-pass/header.text new file mode 100644 index 0000000..b20ad13 --- /dev/null +++ b/t/docs-pythonmarkdown2-tm-cases-pass/header.text @@ -0,0 +1,9 @@ +# an h1
+
+## an h2
+
+another h1
+==========
+
+another h2
+----------
diff --git a/t/docs-pythonmarkdown2-tm-cases-pass/hr.html b/t/docs-pythonmarkdown2-tm-cases-pass/hr.html new file mode 100644 index 0000000..442117e --- /dev/null +++ b/t/docs-pythonmarkdown2-tm-cases-pass/hr.html @@ -0,0 +1,12 @@ +<p>Dashes:</p> + +<hr /> + +<hr /> + +<hr /> + +<hr /> + +<pre><code>--- +</code></pre> diff --git a/t/docs-pythonmarkdown2-tm-cases-pass/hr.text b/t/docs-pythonmarkdown2-tm-cases-pass/hr.text new file mode 100644 index 0000000..765b735 --- /dev/null +++ b/t/docs-pythonmarkdown2-tm-cases-pass/hr.text @@ -0,0 +1,12 @@ +Dashes: + +--- + + --- + + --- + + --- + + --- + diff --git a/t/docs-pythonmarkdown2-tm-cases-pass/img_in_link.html b/t/docs-pythonmarkdown2-tm-cases-pass/img_in_link.html new file mode 100644 index 0000000..09db27a --- /dev/null +++ b/t/docs-pythonmarkdown2-tm-cases-pass/img_in_link.html @@ -0,0 +1,4 @@ +<p>This example from +<a href="http://orestis.gr/en/blog/2007/05/28/python-markdown-problems/">http://orestis.gr/en/blog/2007/05/28/python-markdown-problems/</a>:</p> + +<p><a href="http://www.google.com/" title="click to visit Google.com"><img src="http://www.google.com/images/logo.gif" alt="the google logo" /></a></p> diff --git a/t/docs-pythonmarkdown2-tm-cases-pass/img_in_link.text b/t/docs-pythonmarkdown2-tm-cases-pass/img_in_link.text new file mode 100644 index 0000000..98f6075 --- /dev/null +++ b/t/docs-pythonmarkdown2-tm-cases-pass/img_in_link.text @@ -0,0 +1,7 @@ +This example from
+<http://orestis.gr/en/blog/2007/05/28/python-markdown-problems/>:
+
+[![the google logo][logo]][google]
+[logo]: http://www.google.com/images/logo.gif
+[google]: http://www.google.com/ "click to visit Google.com"
+
diff --git a/t/docs-pythonmarkdown2-tm-cases-pass/inline_links.html b/t/docs-pythonmarkdown2-tm-cases-pass/inline_links.html new file mode 100644 index 0000000..ad2aa72 --- /dev/null +++ b/t/docs-pythonmarkdown2-tm-cases-pass/inline_links.html @@ -0,0 +1,7 @@ +<p>an inline <a href="/url/">link</a></p> + +<p>a <a href="/url/" title="title">link "with" title</a></p> + +<p>an inline <img src="/url/" alt="image link" /></p> + +<p>an <img src="/url/" alt="image "with" title" title="title" /></p> diff --git a/t/docs-pythonmarkdown2-tm-cases-pass/inline_links.text b/t/docs-pythonmarkdown2-tm-cases-pass/inline_links.text new file mode 100644 index 0000000..444a997 --- /dev/null +++ b/t/docs-pythonmarkdown2-tm-cases-pass/inline_links.text @@ -0,0 +1,7 @@ +an inline [link](/url/) + +a [link "with" title](/url/ "title") + +an inline  + +an  diff --git a/t/docs-pythonmarkdown2-tm-cases-pass/issue2_safe_mode_borks_markup.html b/t/docs-pythonmarkdown2-tm-cases-pass/issue2_safe_mode_borks_markup.html new file mode 100644 index 0000000..c36b6d9 --- /dev/null +++ b/t/docs-pythonmarkdown2-tm-cases-pass/issue2_safe_mode_borks_markup.html @@ -0,0 +1,5 @@ +<h2>Heading 2</h2> + +<p>blah [HTML_REMOVED]alert('this should be removed')[HTML_REMOVED] <strong>blah</strong></p> + +<p>[HTML_REMOVED]alert('as should this')[HTML_REMOVED]</p> diff --git a/t/docs-pythonmarkdown2-tm-cases-pass/issue2_safe_mode_borks_markup.opts b/t/docs-pythonmarkdown2-tm-cases-pass/issue2_safe_mode_borks_markup.opts new file mode 100644 index 0000000..fd31b4e --- /dev/null +++ b/t/docs-pythonmarkdown2-tm-cases-pass/issue2_safe_mode_borks_markup.opts @@ -0,0 +1 @@ +{"safe_mode": "replace"} diff --git a/t/docs-pythonmarkdown2-tm-cases-pass/issue2_safe_mode_borks_markup.text b/t/docs-pythonmarkdown2-tm-cases-pass/issue2_safe_mode_borks_markup.text new file mode 100644 index 0000000..38cb2b5 --- /dev/null +++ b/t/docs-pythonmarkdown2-tm-cases-pass/issue2_safe_mode_borks_markup.text @@ -0,0 +1,6 @@ +## Heading 2 + +blah <script>alert('this should be removed')</script> **blah** + +<script>alert('as should this')</script> + diff --git a/t/docs-pythonmarkdown2-tm-cases-pass/link_defn_alt_title_delims.html b/t/docs-pythonmarkdown2-tm-cases-pass/link_defn_alt_title_delims.html new file mode 100644 index 0000000..57871fb --- /dev/null +++ b/t/docs-pythonmarkdown2-tm-cases-pass/link_defn_alt_title_delims.html @@ -0,0 +1,3 @@ +<p>Alternative delimiters for <a href="http://daringfireball.net/projects/markdown/syntax#link" title="link syntax">link definitions</a> are allowed -- as of +Markdown 1.0.2, I think. Hence, <a href="http://daringfireball.net/projects/markdown/syntax#link" title="link syntax">this link</a> and <a href="http://daringfireball.net/projects/markdown/syntax#link" title="link syntax">this link</a> work +too.</p> diff --git a/t/docs-pythonmarkdown2-tm-cases-pass/link_defn_alt_title_delims.text b/t/docs-pythonmarkdown2-tm-cases-pass/link_defn_alt_title_delims.text new file mode 100644 index 0000000..3d62b11 --- /dev/null +++ b/t/docs-pythonmarkdown2-tm-cases-pass/link_defn_alt_title_delims.text @@ -0,0 +1,7 @@ +Alternative delimiters for [link definitions][link1] are allowed -- as of +Markdown 1.0.2, I think. Hence, [this link][link2] and [this link][link3] work +too. + +[link1]: http://daringfireball.net/projects/markdown/syntax#link "link syntax" +[link2]: http://daringfireball.net/projects/markdown/syntax#link 'link syntax' +[link3]: http://daringfireball.net/projects/markdown/syntax#link (link syntax) diff --git a/t/docs-pythonmarkdown2-tm-cases-pass/link_patterns.html b/t/docs-pythonmarkdown2-tm-cases-pass/link_patterns.html new file mode 100644 index 0000000..6c98ea9 --- /dev/null +++ b/t/docs-pythonmarkdown2-tm-cases-pass/link_patterns.html @@ -0,0 +1 @@ +<p><a href="http://code.activestate.com/recipes/123/">Recipe 123</a> and <a href="http://bugs.activestate.com/show_bug.cgi?id=234">Komodo bug 234</a> are related.</p> diff --git a/t/docs-pythonmarkdown2-tm-cases-pass/link_patterns.opts b/t/docs-pythonmarkdown2-tm-cases-pass/link_patterns.opts new file mode 100644 index 0000000..bd85ea9 --- /dev/null +++ b/t/docs-pythonmarkdown2-tm-cases-pass/link_patterns.opts @@ -0,0 +1,7 @@ +{"extras": ["link-patterns"], + "link_patterns": [ + (re.compile("recipe\s+(\d+)", re.I), r"http://code.activestate.com/recipes/\1/"), + (re.compile("(?:komodo\s+)?bug\s+(\d+)", re.I), r"http://bugs.activestate.com/show_bug.cgi?id=\1"), + ], +} + diff --git a/t/docs-pythonmarkdown2-tm-cases-pass/link_patterns.text b/t/docs-pythonmarkdown2-tm-cases-pass/link_patterns.text new file mode 100644 index 0000000..d8a4081 --- /dev/null +++ b/t/docs-pythonmarkdown2-tm-cases-pass/link_patterns.text @@ -0,0 +1 @@ +Recipe 123 and Komodo bug 234 are related. diff --git a/t/docs-pythonmarkdown2-tm-cases-pass/link_patterns_double_hit.html b/t/docs-pythonmarkdown2-tm-cases-pass/link_patterns_double_hit.html new file mode 100644 index 0000000..4402dcf --- /dev/null +++ b/t/docs-pythonmarkdown2-tm-cases-pass/link_patterns_double_hit.html @@ -0,0 +1 @@ +<p>There once was a <a href="http://bugzilla.mozilla.org/show_bug.cgi?id=123">Mozilla bug 123</a> and a <a href="http://bugs.activestate.com/show_bug.cgi?id=123">Komodo bug 123</a>.</p> diff --git a/t/docs-pythonmarkdown2-tm-cases-pass/link_patterns_double_hit.opts b/t/docs-pythonmarkdown2-tm-cases-pass/link_patterns_double_hit.opts new file mode 100644 index 0000000..d64982d --- /dev/null +++ b/t/docs-pythonmarkdown2-tm-cases-pass/link_patterns_double_hit.opts @@ -0,0 +1,7 @@ +{"extras": ["link-patterns"], + "link_patterns": [ + (re.compile(r'mozilla\s+bug\s+(\d+)', re.I), r'http://bugzilla.mozilla.org/show_bug.cgi?id=\1'), + (re.compile("(?:komodo\s+)?bug\s+(\d+)", re.I), r"http://bugs.activestate.com/show_bug.cgi?id=\1"), + ], +} + diff --git a/t/docs-pythonmarkdown2-tm-cases-pass/link_patterns_double_hit.text b/t/docs-pythonmarkdown2-tm-cases-pass/link_patterns_double_hit.text new file mode 100644 index 0000000..29868b8 --- /dev/null +++ b/t/docs-pythonmarkdown2-tm-cases-pass/link_patterns_double_hit.text @@ -0,0 +1 @@ +There once was a Mozilla bug 123 and a Komodo bug 123. diff --git a/t/docs-pythonmarkdown2-tm-cases-pass/link_patterns_edge_cases.html b/t/docs-pythonmarkdown2-tm-cases-pass/link_patterns_edge_cases.html new file mode 100644 index 0000000..ffd0a72 --- /dev/null +++ b/t/docs-pythonmarkdown2-tm-cases-pass/link_patterns_edge_cases.html @@ -0,0 +1 @@ +<p><a href="http://foo.com/blah_blah_blah/123">Blah 123</a> becomes a line with two underscores.</p> diff --git a/t/docs-pythonmarkdown2-tm-cases-pass/link_patterns_edge_cases.opts b/t/docs-pythonmarkdown2-tm-cases-pass/link_patterns_edge_cases.opts new file mode 100644 index 0000000..99ce0f7 --- /dev/null +++ b/t/docs-pythonmarkdown2-tm-cases-pass/link_patterns_edge_cases.opts @@ -0,0 +1,6 @@ +{"extras": ["link-patterns"], + "link_patterns": [ + (re.compile("Blah\s+(\d+)", re.I), r"http://foo.com/blah_blah_blah/\1"), + ], +} + diff --git a/t/docs-pythonmarkdown2-tm-cases-pass/link_patterns_edge_cases.text b/t/docs-pythonmarkdown2-tm-cases-pass/link_patterns_edge_cases.text new file mode 100644 index 0000000..d1fb62c --- /dev/null +++ b/t/docs-pythonmarkdown2-tm-cases-pass/link_patterns_edge_cases.text @@ -0,0 +1 @@ +Blah 123 becomes a line with two underscores. diff --git a/t/docs-pythonmarkdown2-tm-cases-pass/lists.html b/t/docs-pythonmarkdown2-tm-cases-pass/lists.html new file mode 100644 index 0000000..f34c900 --- /dev/null +++ b/t/docs-pythonmarkdown2-tm-cases-pass/lists.html @@ -0,0 +1,15 @@ +<p>count:</p> + +<ul> +<li>one</li> +<li>two</li> +<li>three</li> +</ul> + +<p>count in spanish:</p> + +<ol> +<li>uno</li> +<li>dos</li> +<li>tres</li> +</ol> diff --git a/t/docs-pythonmarkdown2-tm-cases-pass/lists.text b/t/docs-pythonmarkdown2-tm-cases-pass/lists.text new file mode 100644 index 0000000..8d2b43c --- /dev/null +++ b/t/docs-pythonmarkdown2-tm-cases-pass/lists.text @@ -0,0 +1,11 @@ +count: + +* one +* two +* three + +count in spanish: + +1. uno +2. dos +3. tres diff --git a/t/docs-pythonmarkdown2-tm-cases-pass/mismatched_footnotes.html b/t/docs-pythonmarkdown2-tm-cases-pass/mismatched_footnotes.html new file mode 100644 index 0000000..7ac7bfd --- /dev/null +++ b/t/docs-pythonmarkdown2-tm-cases-pass/mismatched_footnotes.html @@ -0,0 +1,16 @@ +<p>This is sentence has a footnote foo<sup class="footnote-ref" id="fnref-foo"><a href="#fn-foo">1</a></sup> and whamo[^whamo].</p> + +<p>This is another para with a numbered footnote<sup class="footnote-ref" id="fnref-6"><a href="#fn-6">2</a></sup>.</p> + +<div class="footnotes"> +<hr /> +<ol> +<li id="fn-foo"> +<p>Here is the body of the footnote foo. <a href="#fnref-foo" class="footnoteBackLink" title="Jump back to footnote 1 in the text.">↩</a></p> +</li> + +<li id="fn-6"> +<p>Here is the body of the footnote 6. <a href="#fnref-6" class="footnoteBackLink" title="Jump back to footnote 2 in the text.">↩</a></p> +</li> +</ol> +</div> diff --git a/t/docs-pythonmarkdown2-tm-cases-pass/mismatched_footnotes.opts b/t/docs-pythonmarkdown2-tm-cases-pass/mismatched_footnotes.opts new file mode 100644 index 0000000..9dfee9e --- /dev/null +++ b/t/docs-pythonmarkdown2-tm-cases-pass/mismatched_footnotes.opts @@ -0,0 +1 @@ +{"extras": ["footnotes"]} diff --git a/t/docs-pythonmarkdown2-tm-cases-pass/mismatched_footnotes.text b/t/docs-pythonmarkdown2-tm-cases-pass/mismatched_footnotes.text new file mode 100644 index 0000000..d679192 --- /dev/null +++ b/t/docs-pythonmarkdown2-tm-cases-pass/mismatched_footnotes.text @@ -0,0 +1,9 @@ +This is sentence has a footnote foo[^foo] and whamo[^whamo]. + +This is another para with a numbered footnote[^6]. + + +[^foo]: Here is the body of the footnote foo. +[^bar]: Here is the body of the footnote bar. +[^6]: Here is the body of the footnote 6. + diff --git a/t/docs-pythonmarkdown2-tm-cases-pass/missing_link_defn.html b/t/docs-pythonmarkdown2-tm-cases-pass/missing_link_defn.html new file mode 100644 index 0000000..2f8a9e8 --- /dev/null +++ b/t/docs-pythonmarkdown2-tm-cases-pass/missing_link_defn.html @@ -0,0 +1 @@ +<p>This is a [missing link][missing] and a <a href="http://foo.com">used link</a>.</p> diff --git a/t/docs-pythonmarkdown2-tm-cases-pass/missing_link_defn.text b/t/docs-pythonmarkdown2-tm-cases-pass/missing_link_defn.text new file mode 100644 index 0000000..817677f --- /dev/null +++ b/t/docs-pythonmarkdown2-tm-cases-pass/missing_link_defn.text @@ -0,0 +1,7 @@ + +This is a [missing link][missing] and a [used link][used]. + + +[used]: http://foo.com +[unused]: http://foo.com + diff --git a/t/docs-pythonmarkdown2-tm-cases-pass/nested_list.html b/t/docs-pythonmarkdown2-tm-cases-pass/nested_list.html new file mode 100644 index 0000000..c0617e4 --- /dev/null +++ b/t/docs-pythonmarkdown2-tm-cases-pass/nested_list.html @@ -0,0 +1,15 @@ +<p>shopping list:</p> + +<ul> +<li>veggies +<ul> +<li>carrots</li> +<li>lettuce</li> +</ul></li> +<li>fruits +<ul> +<li>oranges</li> +<li>apples</li> +<li><em>peaches</em></li> +</ul></li> +</ul> diff --git a/t/docs-pythonmarkdown2-tm-cases-pass/nested_list.text b/t/docs-pythonmarkdown2-tm-cases-pass/nested_list.text new file mode 100644 index 0000000..a37a195 --- /dev/null +++ b/t/docs-pythonmarkdown2-tm-cases-pass/nested_list.text @@ -0,0 +1,9 @@ +shopping list: + +- veggies + + carrots + + lettuce +- fruits + + oranges + + apples + + *peaches* diff --git a/t/docs-pythonmarkdown2-tm-cases-pass/nested_list_safe_mode.html b/t/docs-pythonmarkdown2-tm-cases-pass/nested_list_safe_mode.html new file mode 100644 index 0000000..c0617e4 --- /dev/null +++ b/t/docs-pythonmarkdown2-tm-cases-pass/nested_list_safe_mode.html @@ -0,0 +1,15 @@ +<p>shopping list:</p> + +<ul> +<li>veggies +<ul> +<li>carrots</li> +<li>lettuce</li> +</ul></li> +<li>fruits +<ul> +<li>oranges</li> +<li>apples</li> +<li><em>peaches</em></li> +</ul></li> +</ul> diff --git a/t/docs-pythonmarkdown2-tm-cases-pass/nested_list_safe_mode.opts b/t/docs-pythonmarkdown2-tm-cases-pass/nested_list_safe_mode.opts new file mode 100644 index 0000000..ccb6a09 --- /dev/null +++ b/t/docs-pythonmarkdown2-tm-cases-pass/nested_list_safe_mode.opts @@ -0,0 +1 @@ +{'safe_mode': True} diff --git a/t/docs-pythonmarkdown2-tm-cases-pass/nested_list_safe_mode.text b/t/docs-pythonmarkdown2-tm-cases-pass/nested_list_safe_mode.text new file mode 100644 index 0000000..a37a195 --- /dev/null +++ b/t/docs-pythonmarkdown2-tm-cases-pass/nested_list_safe_mode.text @@ -0,0 +1,9 @@ +shopping list: + +- veggies + + carrots + + lettuce +- fruits + + oranges + + apples + + *peaches* diff --git a/t/docs-pythonmarkdown2-tm-cases-pass/parens_in_url_4.html b/t/docs-pythonmarkdown2-tm-cases-pass/parens_in_url_4.html new file mode 100644 index 0000000..6535e80 --- /dev/null +++ b/t/docs-pythonmarkdown2-tm-cases-pass/parens_in_url_4.html @@ -0,0 +1 @@ +<p><a href="/url(test)" title="title">Inline link 4 with non-escaped parens</a>.</p> diff --git a/t/docs-pythonmarkdown2-tm-cases-pass/parens_in_url_4.text b/t/docs-pythonmarkdown2-tm-cases-pass/parens_in_url_4.text new file mode 100644 index 0000000..5dfb9ab --- /dev/null +++ b/t/docs-pythonmarkdown2-tm-cases-pass/parens_in_url_4.text @@ -0,0 +1 @@ +[Inline link 4 with non-escaped parens](</url(test)> "title"). diff --git a/t/docs-pythonmarkdown2-tm-cases-pass/raw_html.html b/t/docs-pythonmarkdown2-tm-cases-pass/raw_html.html new file mode 100644 index 0000000..ec135c6 --- /dev/null +++ b/t/docs-pythonmarkdown2-tm-cases-pass/raw_html.html @@ -0,0 +1,5 @@ +<p>Hi, <span foo="*bar*"><em>there</em></span>. <!-- *blah* --> blah</p> + +<div> + **ack** +</div> diff --git a/t/docs-pythonmarkdown2-tm-cases-pass/raw_html.text b/t/docs-pythonmarkdown2-tm-cases-pass/raw_html.text new file mode 100644 index 0000000..13cde37 --- /dev/null +++ b/t/docs-pythonmarkdown2-tm-cases-pass/raw_html.text @@ -0,0 +1,6 @@ + +Hi, <span foo="*bar*">*there*</span>. <!-- *blah* --> blah + +<div> + **ack** +</div> diff --git a/t/docs-pythonmarkdown2-tm-cases-pass/ref_links.html b/t/docs-pythonmarkdown2-tm-cases-pass/ref_links.html new file mode 100644 index 0000000..406f8b5 --- /dev/null +++ b/t/docs-pythonmarkdown2-tm-cases-pass/ref_links.html @@ -0,0 +1 @@ +<p><a href="http://www.google.com/">Google</a> is fast <img src="/img/star.png" alt="star" />.</p> diff --git a/t/docs-pythonmarkdown2-tm-cases-pass/ref_links.text b/t/docs-pythonmarkdown2-tm-cases-pass/ref_links.text new file mode 100644 index 0000000..4df8c01 --- /dev/null +++ b/t/docs-pythonmarkdown2-tm-cases-pass/ref_links.text @@ -0,0 +1,6 @@ +[Google][] is fast ![star][]. + +[google]: http://www.google.com/ +[star]: /img/star.png + + diff --git a/t/docs-pythonmarkdown2-tm-cases-pass/sublist-para.html b/t/docs-pythonmarkdown2-tm-cases-pass/sublist-para.html new file mode 100644 index 0000000..a2f551b --- /dev/null +++ b/t/docs-pythonmarkdown2-tm-cases-pass/sublist-para.html @@ -0,0 +1,17 @@ +<p>Some quick thoughts from a coder's perspective:</p> + +<ul> +<li><p>The source will be available in a Mercurial ...</p></li> +<li><p>Komodo is a Mozilla-based application...</p> + +<ul> +<li>Get a slightly tweaked mozilla build (C++, JavaScript, XUL).</li> +<li>Get a slightly tweaks Python build (C).</li> +<li>Add a bunch of core logic (Python)...</li> +<li>Add Komodo chrome (XUL, JavaScript, CSS, DTDs).</li> +</ul> + +<p><p>What this means is that work on and add significant functionality...</p></li> +<li><p>Komodo uses the same extension mechanisms as Firefox...</p></li> +<li><p>Komodo builds and runs on Windows, Linux and ...</p></li> +</ul></p> diff --git a/t/docs-pythonmarkdown2-tm-cases-pass/sublist-para.text b/t/docs-pythonmarkdown2-tm-cases-pass/sublist-para.text new file mode 100644 index 0000000..7bf07ba --- /dev/null +++ b/t/docs-pythonmarkdown2-tm-cases-pass/sublist-para.text @@ -0,0 +1,17 @@ +Some quick thoughts from a coder's perspective: + +- The source will be available in a Mercurial ... + +- Komodo is a Mozilla-based application... + + - Get a slightly tweaked mozilla build (C++, JavaScript, XUL). + - Get a slightly tweaks Python build (C). + - Add a bunch of core logic (Python)... + - Add Komodo chrome (XUL, JavaScript, CSS, DTDs). + + What this means is that work on and add significant functionality... + +- Komodo uses the same extension mechanisms as Firefox... + +- Komodo builds and runs on Windows, Linux and ... + diff --git a/t/docs-pythonmarkdown2-tm-cases-pass/syntax_color.html b/t/docs-pythonmarkdown2-tm-cases-pass/syntax_color.html new file mode 100644 index 0000000..2e172c1 --- /dev/null +++ b/t/docs-pythonmarkdown2-tm-cases-pass/syntax_color.html @@ -0,0 +1,15 @@ +<p>Here is some sample code:</p> + +<div class="codehilite"><pre><code><span class="k">import</span> <span class="nn">sys</span> +<span class="k">def</span> <span class="nf">main</span><span class="p">(</span><span class="n">argv</span><span class="o">=</span><span class="n">sys</span><span class="o">.</span><span class="n">argv</span><span class="p">):</span> + <span class="n">logging</span><span class="o">.</span><span class="n">basicConfig</span><span class="p">()</span> + <span class="n">log</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s">'hi'</span><span class="p">)</span> +</code></pre></div> + +<p>and:</p> + +<div class="codehilite"><pre><code><span class="n">use</span> <span class="s1">'zlib'</span> +<span class="nb">sub</span> <span class="n">main</span><span class="p">(</span><span class="n">argv</span><span class="p">)</span> + <span class="nb">puts</span> <span class="s1">'hi'</span> +<span class="k">end</span> +</code></pre></div> diff --git a/t/docs-pythonmarkdown2-tm-cases-pass/syntax_color.opts b/t/docs-pythonmarkdown2-tm-cases-pass/syntax_color.opts new file mode 100644 index 0000000..95dfd41 --- /dev/null +++ b/t/docs-pythonmarkdown2-tm-cases-pass/syntax_color.opts @@ -0,0 +1 @@ +{"extras": ["code-color"]} diff --git a/t/docs-pythonmarkdown2-tm-cases-pass/syntax_color.text b/t/docs-pythonmarkdown2-tm-cases-pass/syntax_color.text new file mode 100644 index 0000000..b4b30e5 --- /dev/null +++ b/t/docs-pythonmarkdown2-tm-cases-pass/syntax_color.text @@ -0,0 +1,15 @@ +Here is some sample code: + + :::python + import sys + def main(argv=sys.argv): + logging.basicConfig() + log.info('hi') + +and: + + :::ruby + use 'zlib' + sub main(argv) + puts 'hi' + end diff --git a/t/docs-pythonmarkdown2-tm-cases-pass/tricky_anchors.html b/t/docs-pythonmarkdown2-tm-cases-pass/tricky_anchors.html new file mode 100644 index 0000000..0ec6204 --- /dev/null +++ b/t/docs-pythonmarkdown2-tm-cases-pass/tricky_anchors.html @@ -0,0 +1,11 @@ +<p><a href="/url/">with [brackets][] in text</a></p> + +<p><a href="/url/" title="a title">with [[brackets][]] in text</a></p> + +<p><a href="/url/">full link [like](/this/) in text</a></p> + +<p><a href="/url/">full link to img <img src="/this/" alt="like" /> is ok</a></p> + +<p>[only open <a href="/url/" title="a title">bracket(/in/) text</a></p> + +<p><a href="/in/">only close bracket</a> text](/url/)</p> diff --git a/t/docs-pythonmarkdown2-tm-cases-pass/tricky_anchors.text b/t/docs-pythonmarkdown2-tm-cases-pass/tricky_anchors.text new file mode 100644 index 0000000..217f685 --- /dev/null +++ b/t/docs-pythonmarkdown2-tm-cases-pass/tricky_anchors.text @@ -0,0 +1,11 @@ +[with [brackets][] in text](/url/) + +[with [[brackets][]] in text](/url/ "a title") + +[full link [like](/this/) in text](/url/) + +[full link to img  is ok](/url/) + +[only open [bracket(/in/) text](/url/ 'a title') + +[only close bracket](/in/) text](/url/) diff --git a/t/docs-pythonmarkdown2-tm-cases-pass/underline_in_autolink.html b/t/docs-pythonmarkdown2-tm-cases-pass/underline_in_autolink.html new file mode 100644 index 0000000..9fef884 --- /dev/null +++ b/t/docs-pythonmarkdown2-tm-cases-pass/underline_in_autolink.html @@ -0,0 +1,2 @@ +<p>Eric wrote up a (long) intro to writing UDL definitions a while back on +his blog: <a href="http://blogs.activestate.com/ericp/2007/01/kid_adding_a_ne.html">http://blogs.activestate.com/ericp/2007/01/kid_adding_a_ne.html</a></p> diff --git a/t/docs-pythonmarkdown2-tm-cases-pass/underline_in_autolink.text b/t/docs-pythonmarkdown2-tm-cases-pass/underline_in_autolink.text new file mode 100644 index 0000000..58ae3e0 --- /dev/null +++ b/t/docs-pythonmarkdown2-tm-cases-pass/underline_in_autolink.text @@ -0,0 +1,2 @@ +Eric wrote up a (long) intro to writing UDL definitions a while back on +his blog: <http://blogs.activestate.com/ericp/2007/01/kid_adding_a_ne.html> diff --git a/t/rt37909.t b/t/rt37909.t new file mode 100644 index 0000000..dcd50be --- /dev/null +++ b/t/rt37909.t @@ -0,0 +1,10 @@ +use strict; +use warnings; +use Test::More tests => 2; + +use_ok( 'Text::Markdown', 'markdown' ); + +my $m = Text::Markdown->new; +my $html1 = $m->markdown('<a+b@c.org>'); +like( $html1, qr/<p><a href=".+&#.+">.+&#.+<\/a><\/p>/ ); + diff --git a/t/rt48943.t b/t/rt48943.t new file mode 100644 index 0000000..bce9330 --- /dev/null +++ b/t/rt48943.t @@ -0,0 +1,11 @@ +use strict; +use warnings; +use Test::More tests => 2; + +use_ok( 'Text::Markdown', 'markdown' ); + +my $str = '<h1 class=center>foo</h1>'; +my $m = Text::Markdown->new; +my $html1 = $m->markdown($str); +like( $html1, qr/^$str/ ); + |
