From a5cc42b5e441af8f34a122624d136cfcb772c65e Mon Sep 17 00:00:00 2001 From: Waylan Limberg Date: Fri, 22 Aug 2008 17:37:37 -0400 Subject: Fixed Ticket 13. Raw block-level html are no longer being inserted into

tags. Also edited numerious tests that were expecting wrong output - they now expect correct output. Note that a few **still fail** because the output before moving to ELementTree wasn't correct either. So I set the expected output to what I think it should be so we don't forget about it later. I should also note that the 'safe-mode' tests are failing. However, I believe the current expected output is correct as it is valid html. Interestingly, these tests passed prior to this fix. We'll need to special case safe-mode here. --- tests/markdown-test/inline-html-advanced.html | 7 ++- tests/markdown-test/inline-html-comments.html | 11 ++-- tests/markdown-test/inline-html-simple.html | 55 +++++++++++------- .../markdown-documentation-basics.html | 8 +-- tests/markdown-test/markdown-syntax.html | 65 ++++++++++++++-------- tests/misc/CRLF_line_ends.html | 4 +- tests/misc/comments.html | 5 +- tests/misc/div.html | 7 ++- tests/misc/hash.html | 10 ++-- tests/misc/mismatched-tags.html | 6 +- tests/misc/more_comments.html | 6 +- tests/misc/multi-line-tags.html | 5 +- tests/misc/multiline-comments.html | 15 +++-- tests/misc/php.html | 13 +++-- tests/misc/pre.html | 9 +-- tests/misc/span.html | 8 ++- 16 files changed, 140 insertions(+), 94 deletions(-) (limited to 'tests') diff --git a/tests/markdown-test/inline-html-advanced.html b/tests/markdown-test/inline-html-advanced.html index 0f922e9..af1dec1 100644 --- a/tests/markdown-test/inline-html-advanced.html +++ b/tests/markdown-test/inline-html-advanced.html @@ -1,11 +1,12 @@

Simple block on one line:

-

foo

+
foo
+

And nested without indentation:

-

+
foo
bar
-

\ No newline at end of file +
\ 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 8b538d6..0d4cad9 100644 --- a/tests/markdown-test/inline-html-comments.html +++ b/tests/markdown-test/inline-html-comments.html @@ -1,8 +1,11 @@

Paragraph one.

-

-

+ +

+--> +

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 efb50dc..df98803 100644 --- a/tests/markdown-test/inline-html-simple.html +++ b/tests/markdown-test/inline-html-simple.html @@ -1,53 +1,66 @@

Here's a simple block:

-

+
foo -

+
+

This should be a code block, though:

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

As should this:

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

Now, nested:

-

+
foo
-

+
+

This should just be an HTML comment:

-

+ +

Multiline:

-

+--> +

Code block:

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

Just plain comment, with trailing spaces on the line:

-

+ +

Code:

-<hr />
+  <hr />
 
 

Hr's:

-


-


-


-


-


-


-


-


-


\ No newline at end of file +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
\ 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 6755f77..bc654d2 100644 --- a/tests/markdown-test/markdown-documentation-basics.html +++ b/tests/markdown-test/markdown-documentation-basics.html @@ -1,11 +1,12 @@

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 @@ -294,5 +295,4 @@ you've got to put paragraph tags in your blockquotes:</p> &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 b3df92f..a0c12c1 100644 --- a/tests/markdown-test/markdown-syntax.html +++ b/tests/markdown-test/markdown-syntax.html @@ -1,11 +1,12 @@

Markdown: Syntax

-

+
  • Overview @@ -77,8 +78,10 @@ Note: This document is itself written using Markdown; you can see the source for it by adding '.text' to the URL.


    -

    Overview

    -

    Philosophy

    +

    Overview

    + +

    Philosophy

    +

    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 @@ -93,7 +96,8 @@ 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.

    -

    Inline HTML

    +

    Inline HTML

    +

    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 @@ -136,7 +140,8 @@ you'd prefer to use HTML <a> or <img> tags link or image syntax, go right ahead.

    Unlike block-level HTML tags, Markdown syntax is processed within span-level tags.

    -

    Automatic Escaping for Special Characters

    +

    Automatic Escaping for Special Characters

    +

    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 @@ -194,8 +199,10 @@ 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.)


    -

    Block Elements

    -

    Paragraphs and Line Breaks

    +

    Block Elements

    + +

    Paragraphs and Line Breaks

    +

    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 @@ -211,7 +218,8 @@ end a line with two or more spaces, then type return.

    "every line break is a <br />" rule wouldn't work for Markdown. Markdown's email-style blockquoting and multi-paragraph list items work best -- and look better -- when you format them with hard breaks.

    -

    + +

    Markdown supports two styles of headers, Setext and atx.

    Setext-style headers are "underlined" using equal signs (for first-level headers) and dashes (for second-level headers). For example:

    @@ -247,7 +255,8 @@ determines the header level.) :

    ### This is an H3 ######
    -

    Blockquotes

    +

    Blockquotes

    +

    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 @@ -298,7 +307,8 @@ and code blocks:

    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.

    -

    Lists

    +

    Lists

    +

    Markdown supports ordered (numbered) and unordered (bulleted) lists.

    Unordered lists use asterisks, pluses, and hyphens -- interchangably -- as list markers:

    @@ -469,7 +479,8 @@ line. To avoid this, you can backslash-escape the period:

    1986\. What a great season. -

    Code Blocks

    +

    Code Blocks

    +

    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 @@ -534,7 +545,8 @@ ampersands and angle brackets. For example, this:

    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.

    -

    Horizontal Rules

    +

    Horizontal Rules

    +

    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 @@ -554,8 +566,10 @@ _ _ _


    -

    Span Elements

    -

    +

    Span Elements

    + + +

    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 @@ -707,7 +721,8 @@ 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.

    -

    Emphasis

    +

    Emphasis

    +

    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 @@ -749,7 +764,8 @@ escape it:

    \*this text is surrounded by literal asterisks\* -

    Code

    +

    Code

    +

    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:

    @@ -812,7 +828,8 @@ tags. Markdown will turn this:

    equivalent of <code>&amp;mdash;</code>.</p> -

    Images

    +

    Images

    +

    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 @@ -848,8 +865,10 @@ are defined using syntax identical to link references:

    dimensions of an image; if this is important to you, you can simply use regular HTML <img> tags.


    -

    Miscellaneous

    -

    +

    Miscellaneous

    + + +

    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/>
    @@ -881,7 +900,8 @@ spambots. For example, Markdown will turn this:

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

    -

    Backslash Escapes

    +

    Backslash Escapes

    +

    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 @@ -906,5 +926,4 @@ _ underscore . dot ! exclamation mark -

    - + \ No newline at end of file diff --git a/tests/misc/CRLF_line_ends.html b/tests/misc/CRLF_line_ends.html index c650e58..a72b1ca 100644 --- a/tests/misc/CRLF_line_ends.html +++ b/tests/misc/CRLF_line_ends.html @@ -1,4 +1,4 @@

    foo

    -

    +
    bar -

    \ No newline at end of file +
    \ No newline at end of file diff --git a/tests/misc/comments.html b/tests/misc/comments.html index 7a03e53..005a755 100644 --- a/tests/misc/comments.html +++ b/tests/misc/comments.html @@ -1,4 +1,5 @@

    X<0

    X>0

    -

    -

    as if

    \ No newline at end of file + + +
    as if
    \ No newline at end of file diff --git a/tests/misc/div.html b/tests/misc/div.html index 634136c..acd8eaf 100644 --- a/tests/misc/div.html +++ b/tests/misc/div.html @@ -1,5 +1,6 @@ -

    \ No newline at end of file diff --git a/tests/misc/hash.html b/tests/misc/hash.html index 5e8bffb..1865994 100644 --- a/tests/misc/hash.html +++ b/tests/misc/hash.html @@ -1,9 +1,11 @@

    a

    -

    +
     #!/usr/bin/python
    -hello

    +hello
    +

    a

    -

    +
     !/usr/bin/python
    -hello

    +hello
    +

    a

    \ No newline at end of file diff --git a/tests/misc/mismatched-tags.html b/tests/misc/mismatched-tags.html index edeba33..792a8b9 100644 --- a/tests/misc/mismatched-tags.html +++ b/tests/misc/mismatched-tags.html @@ -1,5 +1,3 @@ -

    Some text

    some more text
    +

    Some text

    some more text
    -and a bit more - -

    \ No newline at end of file +

    and a bit more

    diff --git a/tests/misc/more_comments.html b/tests/misc/more_comments.html index d4430cd..37436c5 100644 --- a/tests/misc/more_comments.html +++ b/tests/misc/more_comments.html @@ -1,9 +1,7 @@ -

    -

    +--> + +

    foo -

    -

    +

    + +
    +

    foo

    -

    \ No newline at end of file +
    \ No newline at end of file diff --git a/tests/misc/php.html b/tests/misc/php.html index 66bc8d1..6d91404 100644 --- a/tests/misc/php.html +++ b/tests/misc/php.html @@ -1,9 +1,12 @@ -

    -This should have a p tag +

    This should have a p tag

    + + + +
    This shouldn't
    + + -

    -

    This shouldn't

    -

    <?php echo "not_block_level";?>

    diff --git a/tests/misc/pre.html b/tests/misc/pre.html index 5ac9799..a44ae12 100644 --- a/tests/misc/pre.html +++ b/tests/misc/pre.html @@ -1,12 +1,13 @@ -

    +
     
     aaa
     
     bbb
    -

    -

    +
    + +
     * and this is pre-formatted content
     * and it should be printed just like this
     * and not formatted as a list
     
    -

    \ No newline at end of file +
    \ No newline at end of file diff --git a/tests/misc/span.html b/tests/misc/span.html index dadf5df..bafcf0f 100644 --- a/tests/misc/span.html +++ b/tests/misc/span.html @@ -1,4 +1,6 @@

    Foo bar Baz

    -

    *foo*

    -

    Foo *bar* Baz

    -

    Foo bar Baz

    +
    *foo*
    + +
    Foo *bar* Baz
    + +

    Foo bar Baz

    \ No newline at end of file -- cgit v1.2.3