diff --git a/test/javascripts/mdtest/fixtures/Amps and angle encoding.text b/test/javascripts/mdtest/fixtures/Amps and angle encoding.text new file mode 100644 index 00000000000..0e9527f9311 --- /dev/null +++ b/test/javascripts/mdtest/fixtures/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](). + + +[1]: http://example.com/?foo=1&bar=2 +[2]: http://att.com/ "AT&T" \ No newline at end of file diff --git a/test/javascripts/mdtest/fixtures/Amps and angle encoding.xhtml b/test/javascripts/mdtest/fixtures/Amps and angle encoding.xhtml new file mode 100644 index 00000000000..483f8ffa166 --- /dev/null +++ b/test/javascripts/mdtest/fixtures/Amps and angle encoding.xhtml @@ -0,0 +1,17 @@ +
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.
diff --git a/test/javascripts/mdtest/fixtures/Auto links.text b/test/javascripts/mdtest/fixtures/Auto links.text new file mode 100644 index 00000000000..abbc48869de --- /dev/null +++ b/test/javascripts/mdtest/fixtures/Auto links.text @@ -0,0 +1,13 @@ +Link:Link: http://example.com/.
+ +With an ampersand: http://example.com/?foo=1&bar=2
+ +++ +Blockquoted: http://example.com/
+
Auto-links should not occur here: <http://example.com/>
or here: <http://example.com/>
+
diff --git a/test/javascripts/mdtest/fixtures/Backslash escapes.text b/test/javascripts/mdtest/fixtures/Backslash escapes.text
new file mode 100644
index 00000000000..e30e9654896
--- /dev/null
+++ b/test/javascripts/mdtest/fixtures/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 bar.
+
+This is a tag with backslashes bar.
diff --git a/test/javascripts/mdtest/fixtures/Backslash escapes.xhtml b/test/javascripts/mdtest/fixtures/Backslash escapes.xhtml
new file mode 100644
index 00000000000..750830e8c9e
--- /dev/null
+++ b/test/javascripts/mdtest/fixtures/Backslash escapes.xhtml
@@ -0,0 +1,118 @@
+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 bar.
+ +This is a tag with backslashes bar.
diff --git a/test/javascripts/mdtest/fixtures/Blockquotes with code blocks.text b/test/javascripts/mdtest/fixtures/Blockquotes with code blocks.text new file mode 100644 index 00000000000..c31d171049d --- /dev/null +++ b/test/javascripts/mdtest/fixtures/Blockquotes with code blocks.text @@ -0,0 +1,11 @@ +> Example: +> +> sub status { +> print "working"; +> } +> +> Or: +> +> sub status { +> return "working"; +> } diff --git a/test/javascripts/mdtest/fixtures/Blockquotes with code blocks.xhtml b/test/javascripts/mdtest/fixtures/Blockquotes with code blocks.xhtml new file mode 100644 index 00000000000..cb345349955 --- /dev/null +++ b/test/javascripts/mdtest/fixtures/Blockquotes with code blocks.xhtml @@ -0,0 +1,15 @@ ++diff --git a/test/javascripts/mdtest/fixtures/Code Blocks.text b/test/javascripts/mdtest/fixtures/Code Blocks.text new file mode 100644 index 00000000000..b54b09285a7 --- /dev/null +++ b/test/javascripts/mdtest/fixtures/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/test/javascripts/mdtest/fixtures/Code Blocks.xhtml b/test/javascripts/mdtest/fixtures/Code Blocks.xhtml new file mode 100644 index 00000000000..f6461051af6 --- /dev/null +++ b/test/javascripts/mdtest/fixtures/Code Blocks.xhtml @@ -0,0 +1,17 @@ +Example:
+ ++ +sub status { + print "working"; +} +
Or:
+ ++sub status { + return "working"; +} +
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
+
diff --git a/test/javascripts/mdtest/fixtures/Code Spans.text b/test/javascripts/mdtest/fixtures/Code Spans.text
new file mode 100644
index 00000000000..fbef1f5f1d1
--- /dev/null
+++ b/test/javascripts/mdtest/fixtures/Code Spans.text
@@ -0,0 +1,5 @@
+`<test a="
content of attribute ">
Fix for backticks within HTML tag: like this
+ +Here's how you put `backticks`
in a code span.
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/test/javascripts/mdtest/fixtures/Horizontal rules.text b/test/javascripts/mdtest/fixtures/Horizontal rules.text new file mode 100644 index 00000000000..1594bda27b4 --- /dev/null +++ b/test/javascripts/mdtest/fixtures/Horizontal rules.text @@ -0,0 +1,67 @@ +Dashes: + +--- + + --- + + --- + + --- + + --- + +- - - + + - - - + + - - - + + - - - + + - - - + + +Asterisks: + +*** + + *** + + *** + + *** + + *** + +* * * + + * * * + + * * * + + * * * + + * * * + + +Underscores: + +___ + + ___ + + ___ + + ___ + + ___ + +_ _ _ + + _ _ _ + + _ _ _ + + _ _ _ + + _ _ _ diff --git a/test/javascripts/mdtest/fixtures/Horizontal rules.xhtml b/test/javascripts/mdtest/fixtures/Horizontal rules.xhtml new file mode 100644 index 00000000000..2dc2ab65659 --- /dev/null +++ b/test/javascripts/mdtest/fixtures/Horizontal rules.xhtml @@ -0,0 +1,71 @@ +Dashes:
+ +---
+
+
+- - -
+
+
+Asterisks:
+ +***
+
+
+* * *
+
+
+Underscores:
+ +___
+
+
+_ _ _
+
diff --git a/test/javascripts/mdtest/fixtures/Images.text b/test/javascripts/mdtest/fixtures/Images.text
new file mode 100644
index 00000000000..5707590915a
--- /dev/null
+++ b/test/javascripts/mdtest/fixtures/Images.text
@@ -0,0 +1,26 @@
+![Alt text](/path/to/img.jpg)
+
+![Alt text](/path/to/img.jpg "Optional title")
+
+Inline within a paragraph: [alt text](/url/).
+
+![alt text](/url/ "title preceded by two spaces")
+
+![alt text](/url/ "title has spaces afterward" )
+
+![alt text]()
+
+![alt text]( "with a title").
+
+![Empty]()
+
+![this is a stupid URL](http://example.com/(parens).jpg)
+
+
+![alt text][foo]
+
+ [foo]: /url/
+
+![alt text][bar]
+
+ [bar]: /url/ "Title here"
\ No newline at end of file
diff --git a/test/javascripts/mdtest/fixtures/Images.xhtml b/test/javascripts/mdtest/fixtures/Images.xhtml
new file mode 100644
index 00000000000..fdec8ebcb6c
--- /dev/null
+++ b/test/javascripts/mdtest/fixtures/Images.xhtml
@@ -0,0 +1,21 @@
+
+
+
+
+Inline within a paragraph: alt text.
+ + + + + + + +.
+ + + + + + + + diff --git a/test/javascripts/mdtest/fixtures/Inline HTML (Advanced).text b/test/javascripts/mdtest/fixtures/Inline HTML (Advanced).text new file mode 100644 index 00000000000..0c59e89516f --- /dev/null +++ b/test/javascripts/mdtest/fixtures/Inline HTML (Advanced).text @@ -0,0 +1,30 @@ +Simple block on one line: + +Simple block on one line:
+ +And nested without indentation:
+ +And with attributes:
+ +This was broken in 1.0.2b7:
+ +Here's a simple block:
+ +This should be a code block, though:
+ +<div>
+ foo
+</div>
+
+
+As should this:
+ +<div>foo</div>
+
+
+Now, nested:
+ +This should just be an HTML comment:
+ + + +Multiline:
+ + + +Code block:
+ +<!-- Comment -->
+
+
+Just plain comment, with trailing spaces on the line:
+ + + +Code:
+ +<hr />
+
+
+Hr's:
+ +Paragraph one.
+ + + + + +Paragraph two.
+ + + +The end.
diff --git a/test/javascripts/mdtest/fixtures/Links, inline style.text b/test/javascripts/mdtest/fixtures/Links, inline style.text new file mode 100644 index 00000000000..ad5f021fce9 --- /dev/null +++ b/test/javascripts/mdtest/fixtures/Links, inline style.text @@ -0,0 +1,24 @@ +Just a [LINK](/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 w/ angle brackets + title]( "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/test/javascripts/mdtest/fixtures/Links, inline style.xhtml b/test/javascripts/mdtest/fixtures/Links, inline style.xhtml new file mode 100644 index 00000000000..70d02398ec8 --- /dev/null +++ b/test/javascripts/mdtest/fixtures/Links, inline style.xhtml @@ -0,0 +1,23 @@ +Just a LINK.
+ + + + + + + + + +URL wrapped in angle brackets.
+ +URL w/ angle brackets + title.
+ + + + + +(With outer parens and parens in url)
+ + + +(With outer parens and parens in url)
diff --git a/test/javascripts/mdtest/fixtures/Links, reference style.text b/test/javascripts/mdtest/fixtures/Links, reference style.text new file mode 100644 index 00000000000..96d4470d10b --- /dev/null +++ b/test/javascripts/mdtest/fixtures/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/test/javascripts/mdtest/fixtures/Links, reference style.xhtml b/test/javascripts/mdtest/fixtures/Links, reference style.xhtml new file mode 100644 index 00000000000..9eb8ffe694c --- /dev/null +++ b/test/javascripts/mdtest/fixtures/Links, reference style.xhtml @@ -0,0 +1,52 @@ +Foo bar.
+ +Foo bar.
+ +Foo bar.
+ +With embedded [brackets].
+ +Indented once.
+ +Indented twice.
+ +Indented thrice.
+ +Indented [four][] times.
+ +[four]: /url
+
+
+this should work
+ +So should 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 points to something else.
+ +Backslashing should suppress [this] and [this].
+ +Here's one where the link +breaks across lines.
+ +Here's another where the link +breaks across lines, but with a line-ending space.
diff --git a/test/javascripts/mdtest/fixtures/Links, shortcut references.text b/test/javascripts/mdtest/fixtures/Links, shortcut references.text new file mode 100644 index 00000000000..8c44c98feed --- /dev/null +++ b/test/javascripts/mdtest/fixtures/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/test/javascripts/mdtest/fixtures/Links, shortcut references.xhtml b/test/javascripts/mdtest/fixtures/Links, shortcut references.xhtml new file mode 100644 index 00000000000..bf81e939f5e --- /dev/null +++ b/test/javascripts/mdtest/fixtures/Links, shortcut references.xhtml @@ -0,0 +1,9 @@ +This is the simple case.
+ +This one has a line +break.
+ +This one has a line +break with a line-ending space.
+ + diff --git a/test/javascripts/mdtest/fixtures/Literal quotes in titles.text b/test/javascripts/mdtest/fixtures/Literal quotes in titles.text new file mode 100644 index 00000000000..29d0e4235b2 --- /dev/null +++ b/test/javascripts/mdtest/fixtures/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/test/javascripts/mdtest/fixtures/Literal quotes in titles.xhtml b/test/javascripts/mdtest/fixtures/Literal quotes in titles.xhtml new file mode 100644 index 00000000000..611c1ac61f0 --- /dev/null +++ b/test/javascripts/mdtest/fixtures/Literal quotes in titles.xhtml @@ -0,0 +1,3 @@ +Foo bar.
+ +Foo bar.
diff --git a/test/javascripts/mdtest/fixtures/Markdown Documentation - Basics.text b/test/javascripts/mdtest/fixtures/Markdown Documentation - Basics.text new file mode 100644 index 00000000000..01ce740d5ee --- /dev/null +++ b/test/javascripts/mdtest/fixtures/Markdown Documentation - Basics.text @@ -0,0 +1,306 @@ +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] [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 `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.
+ +++ + + +### 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: + +This is a blockquote.
+ +This is the second paragraph in the blockquote.
+ +This is an H2 in a blockquote
+
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.
+ + + +## 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: + +` 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: + +
A list item.
+With multiple paragraphs.
Another item in the list.
This is an + example link.
+ +Optionally, you may include a title attribute in the parentheses: + + This is an [example link](http://example.com/ "With a Title"). + +Output: + +This is an + example link.
+ +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: + +I get 10 times more traffic from Google than from Yahoo or MSN.
+ +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: + +I start my morning with a cup of coffee and + The New York Times.
+ + +### 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] + + [id]: /path/to/img.jpg "Title" + +Both of the above examples produce the same output: + + + + + +### 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 `