Permalink
Browse files

Signed-off-by: Gordon Guthrie gordon@hhypernumbers.com

  • Loading branch information...
1 parent 1c84bdc commit 90639adafc5717d9bbcfab8f8c6a5b71d4a7295f Gordon Guthrie committed Feb 26, 2010
Showing with 3,223 additions and 366 deletions.
  1. +8 −0 README
  2. +8 −0 README.html
  3. +27 −0 priv/make_tests
  4. +89 −1 src/markdown_tests.erl
  5. +453 −365 tests/generate_tests.js
  6. +96 −0 tests/markdownsharp.tests
  7. +21 −0 tests/markdownsharp/mdtest-1.1/Amps_and_angle_encoding.text
  8. +13 −0 tests/markdownsharp/mdtest-1.1/Auto_links.text
  9. +120 −0 tests/markdownsharp/mdtest-1.1/Backslash_escapes.text
  10. +11 −0 tests/markdownsharp/mdtest-1.1/Blockquotes_with_code_blocks.text
  11. +14 −0 tests/markdownsharp/mdtest-1.1/Code_Blocks.text
  12. +5 −0 tests/markdownsharp/mdtest-1.1/Code_Spans.text
  13. +8 −0 tests/markdownsharp/mdtest-1.1/Hard_wrapped_paragraphs_with_list_like_lines.text
  14. +67 −0 tests/markdownsharp/mdtest-1.1/Horizontal_rules.text
  15. +26 −0 tests/markdownsharp/mdtest-1.1/Images.text
  16. +30 −0 tests/markdownsharp/mdtest-1.1/Inline_HTML_Advanced.text
  17. +69 −0 tests/markdownsharp/mdtest-1.1/Inline_HTML_Simple.text
  18. +13 −0 tests/markdownsharp/mdtest-1.1/Inline_HTML_comments.text
  19. +24 −0 tests/markdownsharp/mdtest-1.1/Links_inline_style.text
  20. +71 −0 tests/markdownsharp/mdtest-1.1/Links_reference_style.text
  21. +20 −0 tests/markdownsharp/mdtest-1.1/Links_shortcut_references.text
  22. +7 −0 tests/markdownsharp/mdtest-1.1/Literal_quotes_in_titles.text
  23. +306 −0 tests/markdownsharp/mdtest-1.1/Markdown_Documentation_Basics.text
  24. +888 −0 tests/markdownsharp/mdtest-1.1/Markdown_Documentation_Syntax.text
  25. +5 −0 tests/markdownsharp/mdtest-1.1/Nested_blockquotes.text
  26. +131 −0 tests/markdownsharp/mdtest-1.1/Ordered_and_unordered_lists.text
  27. +7 −0 tests/markdownsharp/mdtest-1.1/Strong_and_em_together.text
  28. +21 −0 tests/markdownsharp/mdtest-1.1/Tabs.text
  29. +5 −0 tests/markdownsharp/mdtest-1.1/Tidyness.text
  30. +15 −0 tests/markdownsharp/mstest-0.1/code-inside-list.text
  31. +1 −0 tests/markdownsharp/mstest-0.1/line-endings-cr.text
  32. +36 −0 tests/markdownsharp/mstest-0.1/line-endings-crlf.text
  33. +36 −0 tests/markdownsharp/mstest-0.1/line-endings-lf.text
  34. +341 −0 tests/markdownsharp/mstest-0.1/markdown-readme.text
  35. +1 −0 tests/markdownsharp/php-markdown/Backslash escapes.text
  36. +6 −0 tests/markdownsharp/php-markdown/Code Spans.text
  37. +8 −0 tests/markdownsharp/php-markdown/Code block in a list item.text
  38. +3 −0 tests/markdownsharp/php-markdown/Email auto links.text
  39. +69 −0 tests/markdownsharp/php-markdown/Emphasis.text
  40. +9 −0 tests/markdownsharp/php-markdown/Headers.text
  41. +29 −0 tests/markdownsharp/php-markdown/Horizontal Rules.text
  42. +15 −0 tests/markdownsharp/php-markdown/Inline HTML (Simple).text
  43. +4 −0 tests/markdownsharp/php-markdown/Inline HTML (Span).text
  44. +9 −0 tests/markdownsharp/php-markdown/Inline HTML comments.text
  45. +17 −0 tests/markdownsharp/php-markdown/Ins & del.text
  46. +1 −0 tests/markdownsharp/php-markdown/Links, inline style.text
  47. +11 −0 tests/markdownsharp/php-markdown/MD5 Hashes.text
  48. +11 −0 tests/markdownsharp/php-markdown/Nesting.text
  49. +22 −0 tests/markdownsharp/php-markdown/PHP-Specific Bugs.text
  50. +14 −0 tests/markdownsharp/php-markdown/Parens in URL.text
  51. +1 −0 tests/markdownsharp/php-markdown/Tight blocks.text
  52. +1 −0 tests/syntax.txt
View
8 README
@@ -1,6 +1,14 @@
Release Notes
=============
+Version 1.1.5 (Interim)
+-----------------------
+
+Integration of additional tests from markdownsharp:
+http://code.google.com/p/markdownsharp/source/browse/trunk/MarkdownSharpTests/#MarkdownSharpTests/testfiles%3Fstate%3Dclosed
+
+17 currently failing which is why this is an interim release
+
Version 1.1.4 Production Bug Fix
--------------------------------
View
@@ -1,6 +1,14 @@
<h1>Release Notes</h1>
+<h2>Version 1.1.5 (Interim)</h2>
+
+
+<p>Integration of additional tests from markdownsharp:
+http://code.google.com/p/markdownsharp/source/browse/trunk/MarkdownSharpTests/#MarkdownSharpTests/testfiles%3Fstate%3Dclosed</p>
+
+<p>17 currently failing which is why this is an interim release</p>
+
<h2>Version 1.1.4 Production Bug Fix</h2>
View
@@ -0,0 +1,27 @@
+#!/usr/local/lib/erlang/erts-5.7.4/bin/escript
+%% -*- erlang -*-
+
+-mode(compile).
+
+main([]) ->
+ CWD = filename:absname(""),
+ Root = CWD ++ "/../tests/markdownsharp/",
+ Dirs = ["mdtest-1.1", "mstest-0.1", "php-markdown"],
+ Files = lists:merge(make_file_lists(Dirs, Root, [])),
+ Tests = read_files(Files, []),
+ File = CWD ++ "/../tests/markdownsharp.tests",
+ {ok, FileHandle} = file:open(File, [append]),
+ write_tests(FileHandle, Tests).
+
+write_tests(FileHandle, []) -> file:close(FileHandle);
+write_tests(FileHandle, [H | T]) -> io:fwrite(FileHandle, "~p,~n", [H]),
+ write_tests(FileHandle, T).
+
+make_file_lists(Dirs, Root, []) ->
+ [filelib:wildcard(Root ++ X ++ "/*") || X <- Dirs].
+
+read_files([], Acc) -> Acc;
+read_files([H | T], Acc) ->
+ {ok, Bin} = file:read_file(H),
+ io:format("H is ~p~nTest is ~p~n", [H, binary_to_list(Bin)]),
+ read_files(T, [binary_to_list(Bin) | Acc]).
View
Oops, something went wrong.
View
Oops, something went wrong.
View
Oops, something went wrong.
@@ -0,0 +1,21 @@
+AT&T has an ampersand in their name.
+
+AT&amp;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"
@@ -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/>
@@ -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>.
@@ -0,0 +1,11 @@
+> Example:
+>
+> sub status {
+> print "working";
+> }
+>
+> Or:
+>
+> sub status {
+> return "working";
+> }
@@ -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
@@ -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.
@@ -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.
@@ -0,0 +1,67 @@
+Dashes:
+
+---
+
+ ---
+
+ ---
+
+ ---
+
+ ---
+
+- - -
+
+ - - -
+
+ - - -
+
+ - - -
+
+ - - -
+
+
+Asterisks:
+
+***
+
+ ***
+
+ ***
+
+ ***
+
+ ***
+
+* * *
+
+ * * *
+
+ * * *
+
+ * * *
+
+ * * *
+
+
+Underscores:
+
+___
+
+ ___
+
+ ___
+
+ ___
+
+ ___
+
+_ _ _
+
+ _ _ _
+
+ _ _ _
+
+ _ _ _
+
+ _ _ _
@@ -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](</url/>)
+
+![alt text](</url/> "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"
@@ -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>
Oops, something went wrong.

0 comments on commit 90639ad

Please sign in to comment.