From a316ac49a6934221b24ec58a6a7dc4c3b30ae1e8 Mon Sep 17 00:00:00 2001 From: Artem Yunusov Date: Mon, 14 Jul 2008 16:17:33 +0500 Subject: A lot of bug fixes. Handlig attributes added, new hr processing. Reformatted test suite for ElementTree output. --- tests/markdown-test/amps-and-angle-encoding.html | 30 +- tests/markdown-test/auto-links.html | 30 +- tests/markdown-test/backlash-escapes.html | 67 +- .../blockquotes-with-dode-blocks.html | 21 +- tests/markdown-test/hard-wrapped.html | 15 +- tests/markdown-test/horizontal-rules.html | 72 +- tests/markdown-test/inline-html-advanced.html | 17 +- tests/markdown-test/inline-html-comments.html | 23 +- tests/markdown-test/inline-html-simple.html | 101 +- tests/markdown-test/links-inline.html | 22 +- tests/markdown-test/links-reference.html | 32 +- tests/markdown-test/literal-quotes.html | 9 +- .../markdown-documentation-basics.html | 308 ++--- tests/markdown-test/markdown-syntax.html | 1280 +++++++++++--------- tests/markdown-test/nested-blockquotes.html | 14 +- .../markdown-test/ordered-and-unordered-list.html | 341 ++---- tests/markdown-test/strong-and-em-together.html | 23 +- tests/markdown-test/tabs.html | 46 +- tests/markdown-test/tidyness.html | 22 +- 19 files changed, 1176 insertions(+), 1297 deletions(-) (limited to 'tests/markdown-test') diff --git a/tests/markdown-test/amps-and-angle-encoding.html b/tests/markdown-test/amps-and-angle-encoding.html index 18df2c3..9c565e5 100644 --- a/tests/markdown-test/amps-and-angle-encoding.html +++ b/tests/markdown-test/amps-and-angle-encoding.html @@ -1,21 +1,9 @@ - -

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 with an ampersand in the URL. -

-

Here's a link with an amersand in the link text: AT&T. -

-

Here's an inline link. -

-

Here's an inline link. -

- - +

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 linkwith an ampersand in the URL.

+

Here's a link with an amersand in the link text: AT&T.

+

Here's an inline link.

+

Here's an inline link.

\ No newline at end of file diff --git a/tests/markdown-test/auto-links.html b/tests/markdown-test/auto-links.html index 976d22b..100db34 100644 --- a/tests/markdown-test/auto-links.html +++ b/tests/markdown-test/auto-links.html @@ -1,5 +1,4 @@ -

Link: http://example.com/. -

+

Link: http://example.com/.

Https link: https://example.com

Ftp link: ftp://example.com @@ -7,20 +6,19 @@

With an ampersand: http://example.com/?foo=1&bar=2

-

Blockquoted: http://example.com/ +

+

Blockquoted: http://example.com/

-

Auto-links should not occur here: <http://example.com/> +

+

Auto-links should not occur here: <http://example.com/>

-
or here: <http://example.com/>
-
+
+or here: <http://example.com/>
+
+
\ No newline at end of file diff --git a/tests/markdown-test/backlash-escapes.html b/tests/markdown-test/backlash-escapes.html index 77ecde7..f99082a 100644 --- a/tests/markdown-test/backlash-escapes.html +++ b/tests/markdown-test/backlash-escapes.html @@ -1,41 +1,23 @@ - -

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: \\
+

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: \`
 
@@ -66,8 +48,9 @@ Bang: \!
 Plus: \+
 
 Minus: \-
-

Nor should these, which occur in code spans: -

+
+
+

Nor should these, which occur in code spans:

Backslash: \\

Backtick: \` @@ -99,6 +82,4 @@ Minus: \-

Plus: \+

Minus: \- -

- - +

\ No newline at end of file diff --git a/tests/markdown-test/blockquotes-with-dode-blocks.html b/tests/markdown-test/blockquotes-with-dode-blocks.html index 275749f..e7c79d9 100644 --- a/tests/markdown-test/blockquotes-with-dode-blocks.html +++ b/tests/markdown-test/blockquotes-with-dode-blocks.html @@ -1,13 +1,16 @@ - -

Example: -

-
sub status {
+
+

Example:

+
+sub status {
     print "working";
 }
-

Or: -

-
sub status {
+
+
+

Or:

+
+sub status {
     return "working";
 }
-
- +
+
+
\ No newline at end of file diff --git a/tests/markdown-test/hard-wrapped.html b/tests/markdown-test/hard-wrapped.html index 7d16a85..e28e900 100644 --- a/tests/markdown-test/hard-wrapped.html +++ b/tests/markdown-test/hard-wrapped.html @@ -1,12 +1,7 @@ -

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. -

+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. -

- - +* criminey.

\ No newline at end of file diff --git a/tests/markdown-test/horizontal-rules.html b/tests/markdown-test/horizontal-rules.html index 253e36a..98c9c90 100644 --- a/tests/markdown-test/horizontal-rules.html +++ b/tests/markdown-test/horizontal-rules.html @@ -1,63 +1,51 @@ - -

Dashes: -

+

Dashes:


-
-
-
- -
---
-

- +
+---
+
+

-
-
- -
- - -
-

Asterisks: -


- +
+- - -
+
+
+

Asterisks:


-
-
- -
***
-

-
- +
+***
+
+

-
- -
* * *
-

Underscores: -


-
- +
+* * *
+
+
+

Underscores:


-
- -
___
-

-
-
- +
+___
+
+

- -
_ _ _
-
- +
+
+
+
+_ _ _
+
+
diff --git a/tests/markdown-test/inline-html-advanced.html b/tests/markdown-test/inline-html-advanced.html index c72bebb..0f922e9 100644 --- a/tests/markdown-test/inline-html-advanced.html +++ b/tests/markdown-test/inline-html-advanced.html @@ -1,18 +1,11 @@ - -

Simple block on one line: -

-
foo
- -

And nested without indentation: -

-
+

Simple block on one line:

+

foo

+

And nested without indentation:

+

foo
bar
-
- - - +

\ No newline at end of file diff --git a/tests/markdown-test/inline-html-comments.html b/tests/markdown-test/inline-html-comments.html index a85c8b2..8b538d6 100644 --- a/tests/markdown-test/inline-html-comments.html +++ b/tests/markdown-test/inline-html-comments.html @@ -1,17 +1,8 @@ - -

Paragraph one. -

- - -

+

- -

Paragraph two. -

- - -

The end. -

- - +-->

+

Paragraph two.

+

+

The end.

\ No newline at end of file diff --git a/tests/markdown-test/inline-html-simple.html b/tests/markdown-test/inline-html-simple.html index b5b3f12..efb50dc 100644 --- a/tests/markdown-test/inline-html-simple.html +++ b/tests/markdown-test/inline-html-simple.html @@ -1,68 +1,53 @@ - -

Here's a simple block: -

-
+

Here's a simple block:

+

foo -
- -

This should be a code block, though: -

-
<div>
+

+

This should be a code block, though:

+
+<div>
     foo
 </div>
-

As should this: -

-
<div>foo</div>
-

Now, nested: -

-
+ + +

As should this:

+
+<div>foo</div>
+
+
+

Now, nested:

+

foo
-
- -

This should just be an HTML comment: -

- - -

Multiline: -

-

+

Multiline:

+

- -

Code block: -

-
<!-- Comment -->
-

Just plain comment, with trailing spaces on the line: -

- - -

Code: -

-
<hr />
-

Hr's: -

-
- -
- -
- -
- -
- -
- -
- -
- -
- - - +-->

+

Code block:

+
+<!-- Comment -->
+
+
+

Just plain comment, with trailing spaces on the line:

+

+

Code:

+
+<hr />
+
+
+

Hr's:

+


+


+


+


+


+


+


+


+


\ No newline at end of file diff --git a/tests/markdown-test/links-inline.html b/tests/markdown-test/links-inline.html index 5fb7073..e1aaf27 100644 --- a/tests/markdown-test/links-inline.html +++ b/tests/markdown-test/links-inline.html @@ -1,13 +1,9 @@ - -

Just a URL. -

-

URL and title. -

-

URL and title. -

-

URL and title. -

-

Empty. -

- - +

Just a URL.

+

+URL and title.

+

+URL and title.

+

+URL and title.

+

+Empty.

\ No newline at end of file diff --git a/tests/markdown-test/links-reference.html b/tests/markdown-test/links-reference.html index ad6438f..338aa22 100644 --- a/tests/markdown-test/links-reference.html +++ b/tests/markdown-test/links-reference.html @@ -1,20 +1,12 @@ - -

Foo bar. -

-

Foo bar. -

-

Foo bar. -

-

With embedded [brackets]. -

-

Indented once. -

-

Indented twice. -

-

Indented thrice. -

-

Indented [four][] times. -

-
[four]: /url
-
- +

Foo bar.

+

Foo bar.

+

Foo bar.

+

With embedded [brackets].

+

Indented once.

+

Indented twice.

+

Indented thrice.

+

Indented [four][] times.

+
+[four]: /url
+
+
\ No newline at end of file diff --git a/tests/markdown-test/literal-quotes.html b/tests/markdown-test/literal-quotes.html index 806b7f2..0342589 100644 --- a/tests/markdown-test/literal-quotes.html +++ b/tests/markdown-test/literal-quotes.html @@ -1,7 +1,2 @@ - -

Foo bar. -

-

Foo bar. -

- - +

Foo bar.

+

Foo bar.

\ No newline at end of file diff --git a/tests/markdown-test/markdown-documentation-basics.html b/tests/markdown-test/markdown-documentation-basics.html index 744e89d..9c5259f 100644 --- a/tests/markdown-test/markdown-documentation-basics.html +++ b/tests/markdown-test/markdown-documentation-basics.html @@ -1,47 +1,39 @@

Markdown: Basics

-

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 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 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. -

- +The syntax pageprovides 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 Dingusis 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.

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. -

+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
+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
@@ -61,9 +53,11 @@ dog's back.
 > This is the second paragraph in the blockquote.
 >
 > ## This is an H2 in a blockquote
-

Output: -

-
<h1>A First Level Header</h1>
+
+
+

Output:

+
+<h1>A First Level Header</h1>
 
 <h2>A Second Level Header</h2>
 
@@ -83,179 +77,221 @@ dog's back.</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*.
+

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>.
+
+
+

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.
++, and -) as list markers. These three markers are
+interchangable; this:

+
+*   Candy.
 *   Gum.
 *   Booze.
-

this: -

-
+   Candy.
+
+
+

this:

+
++   Candy.
 +   Gum.
 +   Booze.
-

and this: -

-
-   Candy.
+
+
+

and this:

+
+-   Candy.
 -   Gum.
 -   Booze.
-

all produce the same output: -

-
<ul>
+
+
+

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
+
+
+

Ordered (numbered) lists use regular numbers, followed by periods, as +list markers:

+
+1.  Red
 2.  Green
 3.  Blue
-

Output: -

-
<ol>
+
+
+

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.
+
+
+

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>
+
+
+

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. -

+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/">
+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">
+
+
+

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
+
+
+

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/"
+
+
+

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 title attribute is optional. Link names may contain letters, +numbers and spaces, but are notcase 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
+
+
+

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): -

-
![alt text](/path/to/img.jpg "Title")
-

Reference-style: -

-
![alt text][id]
+

Image syntax is very much like link syntax.

+

Inline (titles are optional):

+
+![alt text](/path/to/img.jpg "Title")
+
+
+

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" />
-
+
+
+

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.
+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 `&mdash;`
 instead of decimal-encoded entites like `&#8212;`.
-

Output: -

-
<p>I strongly recommend against using any
+
+
+

Output:

+
+<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>
-

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,
+
+
+

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,
+
+
+

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>&lt;blockquote&gt;
     &lt;p&gt;For example.&lt;/p&gt;
 &lt;/blockquote&gt;
 </code></pre>
-
\ No newline at end of file +
+
diff --git a/tests/markdown-test/markdown-syntax.html b/tests/markdown-test/markdown-syntax.html index 40f9547..84fe3bd 100644 --- a/tests/markdown-test/markdown-syntax.html +++ b/tests/markdown-test/markdown-syntax.html @@ -1,128 +1,120 @@

Markdown: Syntax

-