diff --git a/package.json b/package.json
index 86648af..71b1d46 100644
--- a/package.json
+++ b/package.json
@@ -16,6 +16,10 @@
"type": "git",
"url": "https://github.com/coreyti/showdown.git"
},
+ "devDependencies": {
+ "mocha": "*",
+ "should": "*"
+ },
"licenses": [{ "type": "BSD" }],
"main": "./src/showdown"
}
diff --git a/test/cases/anchors-by-reference.html b/test/cases/anchors-by-reference.html
new file mode 100644
index 0000000..9265274
--- /dev/null
+++ b/test/cases/anchors-by-reference.html
@@ -0,0 +1,5 @@
+
+
This is an example reference-style link.
+This is another reference-style link.
+This is a third reference-style link.
+This is a fourth reference-style link.
\ No newline at end of file
diff --git a/test/cases/anchors-by-reference.md b/test/cases/anchors-by-reference.md
new file mode 100644
index 0000000..522f961
--- /dev/null
+++ b/test/cases/anchors-by-reference.md
@@ -0,0 +1,11 @@
+
+This is [an example][id] reference-style link.
+This is [another] [foo] reference-style link.
+This is [a third][bar] reference-style link.
+This is [a fourth][4] reference-style link.
+
+ [id]: http://example.com/ "Optional Title Here"
+ [foo]: http://example.com/ (Optional Title Here)
+ [bar]: http://example.com/ (Optional Title Here)
+ [4]:
+ "Optional Title Here"
\ No newline at end of file
diff --git a/test/cases/automatic-anchors.html b/test/cases/automatic-anchors.html
new file mode 100644
index 0000000..8d32215
--- /dev/null
+++ b/test/cases/automatic-anchors.html
@@ -0,0 +1,2 @@
+
+http://example.com/
\ No newline at end of file
diff --git a/test/cases/automatic-anchors.md b/test/cases/automatic-anchors.md
new file mode 100644
index 0000000..a430e77
--- /dev/null
+++ b/test/cases/automatic-anchors.md
@@ -0,0 +1,2 @@
+
+
\ No newline at end of file
diff --git a/test/cases/blockquote-nested-markdown.html b/test/cases/blockquote-nested-markdown.html
new file mode 100644
index 0000000..25800d7
--- /dev/null
+++ b/test/cases/blockquote-nested-markdown.html
@@ -0,0 +1,13 @@
+
+
+
+
+ - This is the first list item.
+ - This is the second list item.
+
+
+ Here's some example code:
+
+ return shell_exec("echo $input | $markdown_script");
+
+
diff --git a/test/cases/blockquote-nested-markdown.md b/test/cases/blockquote-nested-markdown.md
new file mode 100644
index 0000000..b0d102e
--- /dev/null
+++ b/test/cases/blockquote-nested-markdown.md
@@ -0,0 +1,8 @@
+> ## 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");
\ No newline at end of file
diff --git a/test/cases/blockquote.html b/test/cases/blockquote.html
new file mode 100644
index 0000000..c31f284
--- /dev/null
+++ b/test/cases/blockquote.html
@@ -0,0 +1,5 @@
+
+ This is a multi line blockquote test
+
+ With more than one line.
+
\ No newline at end of file
diff --git a/test/cases/blockquote.md b/test/cases/blockquote.md
new file mode 100644
index 0000000..4d40995
--- /dev/null
+++ b/test/cases/blockquote.md
@@ -0,0 +1,4 @@
+
+ > This is a multi line blockquote test
+ >
+ > With more than one line.
\ No newline at end of file
diff --git a/test/cases/code-block-html-escape.html b/test/cases/code-block-html-escape.html
new file mode 100644
index 0000000..123e4f3
--- /dev/null
+++ b/test/cases/code-block-html-escape.html
@@ -0,0 +1,5 @@
+
+This is some HTML:
+
+<h1>Heading</h1>
+
\ No newline at end of file
diff --git a/test/cases/code-block-html-escape.md b/test/cases/code-block-html-escape.md
new file mode 100644
index 0000000..3f6bc3e
--- /dev/null
+++ b/test/cases/code-block-html-escape.md
@@ -0,0 +1,4 @@
+
+This is some HTML:
+
+ Heading
\ No newline at end of file
diff --git a/test/cases/code-block.html b/test/cases/code-block.html
new file mode 100644
index 0000000..bdb50b4
--- /dev/null
+++ b/test/cases/code-block.html
@@ -0,0 +1,5 @@
+
+This is a normal paragraph:
+
+This is a code block.
+
\ No newline at end of file
diff --git a/test/cases/code-block.md b/test/cases/code-block.md
new file mode 100644
index 0000000..adfac54
--- /dev/null
+++ b/test/cases/code-block.md
@@ -0,0 +1,4 @@
+
+This is a normal paragraph:
+
+ This is a code block.
\ No newline at end of file
diff --git a/test/cases/doubline-list.html b/test/cases/doubline-list.html
new file mode 100644
index 0000000..da41237
--- /dev/null
+++ b/test/cases/doubline-list.html
@@ -0,0 +1,5 @@
+
+
\ No newline at end of file
diff --git a/test/cases/doubline-list.md b/test/cases/doubline-list.md
new file mode 100644
index 0000000..764998c
--- /dev/null
+++ b/test/cases/doubline-list.md
@@ -0,0 +1,4 @@
+
+ * Bird
+
+ * Magic
\ No newline at end of file
diff --git a/test/cases/emphasis.html b/test/cases/emphasis.html
new file mode 100644
index 0000000..056fdea
--- /dev/null
+++ b/test/cases/emphasis.html
@@ -0,0 +1,8 @@
+
+important
+
+important
+
+this midimportantsentence
+
+*not important*
\ No newline at end of file
diff --git a/test/cases/emphasis.md b/test/cases/emphasis.md
new file mode 100644
index 0000000..0e70802
--- /dev/null
+++ b/test/cases/emphasis.md
@@ -0,0 +1,8 @@
+
+*important*
+
+_important_
+
+this mid*important*sentence
+
+\*not important\*
\ No newline at end of file
diff --git a/test/cases/escaped-number-period.html b/test/cases/escaped-number-period.html
new file mode 100644
index 0000000..f773d21
--- /dev/null
+++ b/test/cases/escaped-number-period.html
@@ -0,0 +1 @@
+It happened in 1986. What a great season.
\ No newline at end of file
diff --git a/test/cases/escaped-number-period.md b/test/cases/escaped-number-period.md
new file mode 100644
index 0000000..d321a38
--- /dev/null
+++ b/test/cases/escaped-number-period.md
@@ -0,0 +1 @@
+It happened in 1986\. What a great season.
\ No newline at end of file
diff --git a/test/cases/escaping.html b/test/cases/escaping.html
new file mode 100644
index 0000000..671a2a6
--- /dev/null
+++ b/test/cases/escaping.html
@@ -0,0 +1,32 @@
+
+These should all be escaped:
+
+\
+
+`
+
+*
+
+_
+
+{
+
+}
+
+[
+
+]
+
+(
+
+)
+
+#
+
++
+
+-
+
+.
+
+!
\ No newline at end of file
diff --git a/test/cases/escaping.md b/test/cases/escaping.md
new file mode 100644
index 0000000..ea017af
--- /dev/null
+++ b/test/cases/escaping.md
@@ -0,0 +1,32 @@
+
+These should all be escaped:
+
+\\
+
+\`
+
+\*
+
+\_
+
+\{
+
+\}
+
+\[
+
+\]
+
+\(
+
+\)
+
+\#
+
+\+
+
+\-
+
+\.
+
+\!
\ No newline at end of file
diff --git a/test/cases/github-style-codeblock.html b/test/cases/github-style-codeblock.html
new file mode 100644
index 0000000..8a5db9b
--- /dev/null
+++ b/test/cases/github-style-codeblock.html
@@ -0,0 +1,13 @@
+
+
+Define a function in javascript:
+
+function MyFunc(a) {
+ // ...
+}
+
+
+And some HTML
+
+<div>HTML!</div>
+
\ No newline at end of file
diff --git a/test/cases/github-style-codeblock.md b/test/cases/github-style-codeblock.md
new file mode 100644
index 0000000..5c59c1d
--- /dev/null
+++ b/test/cases/github-style-codeblock.md
@@ -0,0 +1,14 @@
+
+Define a function in javascript:
+
+```
+function MyFunc(a) {
+ // ...
+}
+```
+
+And some HTML
+
+```html
+HTML!
+```
\ No newline at end of file
diff --git a/test/cases/h1-with-double-hash.html b/test/cases/h1-with-double-hash.html
new file mode 100644
index 0000000..2cecc38
--- /dev/null
+++ b/test/cases/h1-with-double-hash.html
@@ -0,0 +1 @@
+This is an H1
\ No newline at end of file
diff --git a/test/cases/h1-with-double-hash.md b/test/cases/h1-with-double-hash.md
new file mode 100644
index 0000000..147d59b
--- /dev/null
+++ b/test/cases/h1-with-double-hash.md
@@ -0,0 +1 @@
+# This is an H1 #
\ No newline at end of file
diff --git a/test/cases/h1-with-equals.html b/test/cases/h1-with-equals.html
new file mode 100644
index 0000000..2cecc38
--- /dev/null
+++ b/test/cases/h1-with-equals.html
@@ -0,0 +1 @@
+This is an H1
\ No newline at end of file
diff --git a/test/cases/h1-with-equals.md b/test/cases/h1-with-equals.md
new file mode 100644
index 0000000..f18b949
--- /dev/null
+++ b/test/cases/h1-with-equals.md
@@ -0,0 +1,2 @@
+This is an H1
+=============
\ No newline at end of file
diff --git a/test/cases/h1-with-single-hash.html b/test/cases/h1-with-single-hash.html
new file mode 100644
index 0000000..2cecc38
--- /dev/null
+++ b/test/cases/h1-with-single-hash.html
@@ -0,0 +1 @@
+This is an H1
\ No newline at end of file
diff --git a/test/cases/h1-with-single-hash.md b/test/cases/h1-with-single-hash.md
new file mode 100644
index 0000000..f6a39e1
--- /dev/null
+++ b/test/cases/h1-with-single-hash.md
@@ -0,0 +1 @@
+# This is an H1
\ No newline at end of file
diff --git a/test/cases/h2-with-dashes.html b/test/cases/h2-with-dashes.html
new file mode 100644
index 0000000..d040d75
--- /dev/null
+++ b/test/cases/h2-with-dashes.html
@@ -0,0 +1 @@
+This is an H2
\ No newline at end of file
diff --git a/test/cases/h2-with-dashes.md b/test/cases/h2-with-dashes.md
new file mode 100644
index 0000000..4564336
--- /dev/null
+++ b/test/cases/h2-with-dashes.md
@@ -0,0 +1,2 @@
+This is an H2
+-------------
\ No newline at end of file
diff --git a/test/cases/h2-with-double-hash.html b/test/cases/h2-with-double-hash.html
new file mode 100644
index 0000000..d040d75
--- /dev/null
+++ b/test/cases/h2-with-double-hash.html
@@ -0,0 +1 @@
+This is an H2
\ No newline at end of file
diff --git a/test/cases/h2-with-double-hash.md b/test/cases/h2-with-double-hash.md
new file mode 100644
index 0000000..b84a1de
--- /dev/null
+++ b/test/cases/h2-with-double-hash.md
@@ -0,0 +1 @@
+## This is an H2 ##
\ No newline at end of file
diff --git a/test/cases/h2-with-single-hash.html b/test/cases/h2-with-single-hash.html
new file mode 100644
index 0000000..d040d75
--- /dev/null
+++ b/test/cases/h2-with-single-hash.html
@@ -0,0 +1 @@
+This is an H2
\ No newline at end of file
diff --git a/test/cases/h2-with-single-hash.md b/test/cases/h2-with-single-hash.md
new file mode 100644
index 0000000..6a93c6b
--- /dev/null
+++ b/test/cases/h2-with-single-hash.md
@@ -0,0 +1 @@
+## This is an H2
\ No newline at end of file
diff --git a/test/cases/h3-with-double-hash.html b/test/cases/h3-with-double-hash.html
new file mode 100644
index 0000000..082318e
--- /dev/null
+++ b/test/cases/h3-with-double-hash.html
@@ -0,0 +1 @@
+This is an H3
\ No newline at end of file
diff --git a/test/cases/h3-with-double-hash.md b/test/cases/h3-with-double-hash.md
new file mode 100644
index 0000000..7d790cf
--- /dev/null
+++ b/test/cases/h3-with-double-hash.md
@@ -0,0 +1 @@
+### This is an H3 ###
\ No newline at end of file
diff --git a/test/cases/h3-with-single-hash.html b/test/cases/h3-with-single-hash.html
new file mode 100644
index 0000000..082318e
--- /dev/null
+++ b/test/cases/h3-with-single-hash.html
@@ -0,0 +1 @@
+This is an H3
\ No newline at end of file
diff --git a/test/cases/h3-with-single-hash.md b/test/cases/h3-with-single-hash.md
new file mode 100644
index 0000000..70c6d10
--- /dev/null
+++ b/test/cases/h3-with-single-hash.md
@@ -0,0 +1 @@
+### This is an H3
\ No newline at end of file
diff --git a/test/cases/h4-with-single-hash.html b/test/cases/h4-with-single-hash.html
new file mode 100644
index 0000000..cc32aa1
--- /dev/null
+++ b/test/cases/h4-with-single-hash.html
@@ -0,0 +1 @@
+This is an H4
\ No newline at end of file
diff --git a/test/cases/h4-with-single-hash.md b/test/cases/h4-with-single-hash.md
new file mode 100644
index 0000000..8283f11
--- /dev/null
+++ b/test/cases/h4-with-single-hash.md
@@ -0,0 +1 @@
+#### This is an H4
\ No newline at end of file
diff --git a/test/cases/h5-with-single-hash.html b/test/cases/h5-with-single-hash.html
new file mode 100644
index 0000000..96dca78
--- /dev/null
+++ b/test/cases/h5-with-single-hash.html
@@ -0,0 +1 @@
+This is an H5
\ No newline at end of file
diff --git a/test/cases/h5-with-single-hash.md b/test/cases/h5-with-single-hash.md
new file mode 100644
index 0000000..abcdd91
--- /dev/null
+++ b/test/cases/h5-with-single-hash.md
@@ -0,0 +1 @@
+##### This is an H5
\ No newline at end of file
diff --git a/test/cases/h6-with-single-hash.html b/test/cases/h6-with-single-hash.html
new file mode 100644
index 0000000..10de690
--- /dev/null
+++ b/test/cases/h6-with-single-hash.html
@@ -0,0 +1 @@
+This is an H6
\ No newline at end of file
diff --git a/test/cases/h6-with-single-hash.md b/test/cases/h6-with-single-hash.md
new file mode 100644
index 0000000..df2ff4c
--- /dev/null
+++ b/test/cases/h6-with-single-hash.md
@@ -0,0 +1 @@
+###### This is an H6
\ No newline at end of file
diff --git a/test/cases/horizontal-rules.html b/test/cases/horizontal-rules.html
new file mode 100644
index 0000000..88eb5de
--- /dev/null
+++ b/test/cases/horizontal-rules.html
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/test/cases/horizontal-rules.md b/test/cases/horizontal-rules.md
new file mode 100644
index 0000000..6a45ca1
--- /dev/null
+++ b/test/cases/horizontal-rules.md
@@ -0,0 +1,10 @@
+
+* * *
+
+***
+
+*****
+
+- - -
+
+---------------------------------------
diff --git a/test/cases/images.html b/test/cases/images.html
new file mode 100644
index 0000000..f214ba1
--- /dev/null
+++ b/test/cases/images.html
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/test/cases/images.md b/test/cases/images.md
new file mode 100644
index 0000000..81ecfbf
--- /dev/null
+++ b/test/cases/images.md
@@ -0,0 +1,8 @@
+
+![Alt text](/path/to/img.jpg)
+
+![Alt text](/path/to/img.jpg "Optional title")
+
+![Alt text][id]
+
+ [id]: url/to/image "Optional title attribute"
\ No newline at end of file
diff --git a/test/cases/implicit-anchors.html b/test/cases/implicit-anchors.html
new file mode 100644
index 0000000..8bb39ff
--- /dev/null
+++ b/test/cases/implicit-anchors.html
@@ -0,0 +1,2 @@
+
+Search the web at Google or Daring Fireball.
\ No newline at end of file
diff --git a/test/cases/implicit-anchors.md b/test/cases/implicit-anchors.md
new file mode 100644
index 0000000..d474773
--- /dev/null
+++ b/test/cases/implicit-anchors.md
@@ -0,0 +1,5 @@
+
+Search the web at [Google][] or [Daring Fireball][].
+
+ [Google]: http://google.com/
+ [Daring Fireball]: http://daringfireball.net/
\ No newline at end of file
diff --git a/test/cases/inline-anchors.html b/test/cases/inline-anchors.html
new file mode 100644
index 0000000..7be05ef
--- /dev/null
+++ b/test/cases/inline-anchors.html
@@ -0,0 +1,4 @@
+
+This is an example inline link.
+
+This link has no title attribute.
\ No newline at end of file
diff --git a/test/cases/inline-anchors.md b/test/cases/inline-anchors.md
new file mode 100644
index 0000000..a0bbd6e
--- /dev/null
+++ b/test/cases/inline-anchors.md
@@ -0,0 +1,4 @@
+
+This is [an example](http://example.com/ "Title") inline link.
+
+[This link](http://example.net/) has no title attribute.
\ No newline at end of file
diff --git a/test/cases/inline-code.html b/test/cases/inline-code.html
new file mode 100644
index 0000000..e1809e6
--- /dev/null
+++ b/test/cases/inline-code.html
@@ -0,0 +1,12 @@
+
+Create a new function
.
+
+Use the backtick in MySQL syntax SELECT `column` FROM whatever
.
+
+A single backtick in a code span: `
+
+A backtick-delimited string in a code span: `foo`
+
+Please don't use any <blink>
tags.
+
+—
is the decimal-encoded equivalent of —
.
\ No newline at end of file
diff --git a/test/cases/inline-code.md b/test/cases/inline-code.md
new file mode 100644
index 0000000..6cc0b2a
--- /dev/null
+++ b/test/cases/inline-code.md
@@ -0,0 +1,12 @@
+
+Create a new `function`.
+
+Use the backtick in MySQL syntax ``SELECT `column` FROM whatever``.
+
+A single backtick in a code span: `` ` ``
+
+A backtick-delimited string in a code span: `` `foo` ``
+
+Please don't use any `