bluecloth 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (103) hide show
  1. data/ChangeLog +629 -0
  2. data/LICENSE +27 -0
  3. data/LICENSE.discount +47 -0
  4. data/README +71 -0
  5. data/Rakefile +319 -0
  6. data/Rakefile.local +63 -0
  7. data/bin/bluecloth +84 -0
  8. data/ext/VERSION +1 -0
  9. data/ext/amalloc.h +29 -0
  10. data/ext/bluecloth.c +373 -0
  11. data/ext/config.h +47 -0
  12. data/ext/cstring.h +73 -0
  13. data/ext/docheader.c +43 -0
  14. data/ext/extconf.rb +45 -0
  15. data/ext/generate.c +1387 -0
  16. data/ext/markdown.c +939 -0
  17. data/ext/markdown.h +135 -0
  18. data/ext/mkdio.c +241 -0
  19. data/ext/mkdio.h +66 -0
  20. data/ext/resource.c +169 -0
  21. data/ext/version.c +28 -0
  22. data/lib/bluecloth.rb +148 -0
  23. data/rake/191_compat.rb +26 -0
  24. data/rake/dependencies.rb +76 -0
  25. data/rake/helpers.rb +412 -0
  26. data/rake/manual.rb +782 -0
  27. data/rake/packaging.rb +116 -0
  28. data/rake/publishing.rb +321 -0
  29. data/rake/rdoc.rb +40 -0
  30. data/rake/style.rb +62 -0
  31. data/rake/svn.rb +639 -0
  32. data/rake/testing.rb +204 -0
  33. data/rake/verifytask.rb +64 -0
  34. data/rake/win32.rb +186 -0
  35. data/spec/bluecloth/101_changes_spec.rb +141 -0
  36. data/spec/bluecloth/autolinks_spec.rb +49 -0
  37. data/spec/bluecloth/blockquotes_spec.rb +143 -0
  38. data/spec/bluecloth/code_spans_spec.rb +164 -0
  39. data/spec/bluecloth/emphasis_spec.rb +164 -0
  40. data/spec/bluecloth/entities_spec.rb +65 -0
  41. data/spec/bluecloth/hrules_spec.rb +90 -0
  42. data/spec/bluecloth/images_spec.rb +92 -0
  43. data/spec/bluecloth/inline_html_spec.rb +238 -0
  44. data/spec/bluecloth/links_spec.rb +171 -0
  45. data/spec/bluecloth/lists_spec.rb +294 -0
  46. data/spec/bluecloth/paragraphs_spec.rb +75 -0
  47. data/spec/bluecloth/titles_spec.rb +305 -0
  48. data/spec/bluecloth_spec.rb +209 -0
  49. data/spec/bugfix_spec.rb +123 -0
  50. data/spec/contributions_spec.rb +85 -0
  51. data/spec/data/antsugar.txt +34 -0
  52. data/spec/data/markdowntest/Amps and angle encoding.html +17 -0
  53. data/spec/data/markdowntest/Amps and angle encoding.text +21 -0
  54. data/spec/data/markdowntest/Auto links.html +18 -0
  55. data/spec/data/markdowntest/Auto links.text +13 -0
  56. data/spec/data/markdowntest/Backslash escapes.html +118 -0
  57. data/spec/data/markdowntest/Backslash escapes.text +120 -0
  58. data/spec/data/markdowntest/Blockquotes with code blocks.html +15 -0
  59. data/spec/data/markdowntest/Blockquotes with code blocks.text +11 -0
  60. data/spec/data/markdowntest/Code Blocks.html +18 -0
  61. data/spec/data/markdowntest/Code Blocks.text +14 -0
  62. data/spec/data/markdowntest/Code Spans.html +5 -0
  63. data/spec/data/markdowntest/Code Spans.text +5 -0
  64. data/spec/data/markdowntest/Hard-wrapped paragraphs with list-like lines.html +8 -0
  65. data/spec/data/markdowntest/Hard-wrapped paragraphs with list-like lines.text +8 -0
  66. data/spec/data/markdowntest/Horizontal rules.html +71 -0
  67. data/spec/data/markdowntest/Horizontal rules.text +67 -0
  68. data/spec/data/markdowntest/Inline HTML (Advanced).html +15 -0
  69. data/spec/data/markdowntest/Inline HTML (Advanced).text +15 -0
  70. data/spec/data/markdowntest/Inline HTML (Simple).html +72 -0
  71. data/spec/data/markdowntest/Inline HTML (Simple).text +69 -0
  72. data/spec/data/markdowntest/Inline HTML comments.html +13 -0
  73. data/spec/data/markdowntest/Inline HTML comments.text +13 -0
  74. data/spec/data/markdowntest/Links, inline style.html +11 -0
  75. data/spec/data/markdowntest/Links, inline style.text +12 -0
  76. data/spec/data/markdowntest/Links, reference style.html +52 -0
  77. data/spec/data/markdowntest/Links, reference style.text +71 -0
  78. data/spec/data/markdowntest/Links, shortcut references.html +9 -0
  79. data/spec/data/markdowntest/Links, shortcut references.text +20 -0
  80. data/spec/data/markdowntest/Literal quotes in titles.html +3 -0
  81. data/spec/data/markdowntest/Literal quotes in titles.text +7 -0
  82. data/spec/data/markdowntest/Markdown Documentation - Basics.html +314 -0
  83. data/spec/data/markdowntest/Markdown Documentation - Basics.text +306 -0
  84. data/spec/data/markdowntest/Markdown Documentation - Syntax.html +942 -0
  85. data/spec/data/markdowntest/Markdown Documentation - Syntax.text +888 -0
  86. data/spec/data/markdowntest/Nested blockquotes.html +9 -0
  87. data/spec/data/markdowntest/Nested blockquotes.text +5 -0
  88. data/spec/data/markdowntest/Ordered and unordered lists.html +148 -0
  89. data/spec/data/markdowntest/Ordered and unordered lists.text +131 -0
  90. data/spec/data/markdowntest/Strong and em together.html +7 -0
  91. data/spec/data/markdowntest/Strong and em together.text +7 -0
  92. data/spec/data/markdowntest/Tabs.html +25 -0
  93. data/spec/data/markdowntest/Tabs.text +21 -0
  94. data/spec/data/markdowntest/Tidyness.html +8 -0
  95. data/spec/data/markdowntest/Tidyness.text +5 -0
  96. data/spec/data/ml-announce.txt +17 -0
  97. data/spec/data/re-overflow.txt +67 -0
  98. data/spec/data/re-overflow2.txt +281 -0
  99. data/spec/lib/constants.rb +5 -0
  100. data/spec/lib/helpers.rb +137 -0
  101. data/spec/lib/matchers.rb +235 -0
  102. data/spec/markdowntest_spec.rb +76 -0
  103. metadata +305 -0
@@ -0,0 +1,9 @@
1
+ <blockquote>
2
+ <p>foo</p>
3
+
4
+ <blockquote>
5
+ <p>bar</p>
6
+ </blockquote>
7
+
8
+ <p>foo</p>
9
+ </blockquote>
@@ -0,0 +1,5 @@
1
+ > foo
2
+ >
3
+ > > bar
4
+ >
5
+ > foo
@@ -0,0 +1,148 @@
1
+ <h2>Unordered</h2>
2
+
3
+ <p>Asterisks tight:</p>
4
+
5
+ <ul>
6
+ <li>asterisk 1</li>
7
+ <li>asterisk 2</li>
8
+ <li>asterisk 3</li>
9
+ </ul>
10
+
11
+ <p>Asterisks loose:</p>
12
+
13
+ <ul>
14
+ <li><p>asterisk 1</p></li>
15
+ <li><p>asterisk 2</p></li>
16
+ <li><p>asterisk 3</p></li>
17
+ </ul>
18
+
19
+ <hr />
20
+
21
+ <p>Pluses tight:</p>
22
+
23
+ <ul>
24
+ <li>Plus 1</li>
25
+ <li>Plus 2</li>
26
+ <li>Plus 3</li>
27
+ </ul>
28
+
29
+ <p>Pluses loose:</p>
30
+
31
+ <ul>
32
+ <li><p>Plus 1</p></li>
33
+ <li><p>Plus 2</p></li>
34
+ <li><p>Plus 3</p></li>
35
+ </ul>
36
+
37
+ <hr />
38
+
39
+ <p>Minuses tight:</p>
40
+
41
+ <ul>
42
+ <li>Minus 1</li>
43
+ <li>Minus 2</li>
44
+ <li>Minus 3</li>
45
+ </ul>
46
+
47
+ <p>Minuses loose:</p>
48
+
49
+ <ul>
50
+ <li><p>Minus 1</p></li>
51
+ <li><p>Minus 2</p></li>
52
+ <li><p>Minus 3</p></li>
53
+ </ul>
54
+
55
+ <h2>Ordered</h2>
56
+
57
+ <p>Tight:</p>
58
+
59
+ <ol>
60
+ <li>First</li>
61
+ <li>Second</li>
62
+ <li>Third</li>
63
+ </ol>
64
+
65
+ <p>and:</p>
66
+
67
+ <ol>
68
+ <li>One</li>
69
+ <li>Two</li>
70
+ <li>Three</li>
71
+ </ol>
72
+
73
+ <p>Loose using tabs:</p>
74
+
75
+ <ol>
76
+ <li><p>First</p></li>
77
+ <li><p>Second</p></li>
78
+ <li><p>Third</p></li>
79
+ </ol>
80
+
81
+ <p>and using spaces:</p>
82
+
83
+ <ol>
84
+ <li><p>One</p></li>
85
+ <li><p>Two</p></li>
86
+ <li><p>Three</p></li>
87
+ </ol>
88
+
89
+ <p>Multiple paragraphs:</p>
90
+
91
+ <ol>
92
+ <li><p>Item 1, graf one.</p>
93
+
94
+ <p>Item 2. graf two. The quick brown fox jumped over the lazy dog's
95
+ back.</p></li>
96
+ <li><p>Item 2.</p></li>
97
+ <li><p>Item 3.</p></li>
98
+ </ol>
99
+
100
+ <h2>Nested</h2>
101
+
102
+ <ul>
103
+ <li>Tab
104
+ <ul>
105
+ <li>Tab
106
+ <ul>
107
+ <li>Tab</li>
108
+ </ul></li>
109
+ </ul></li>
110
+ </ul>
111
+
112
+ <p>Here's another:</p>
113
+
114
+ <ol>
115
+ <li>First</li>
116
+ <li>Second:
117
+ <ul>
118
+ <li>Fee</li>
119
+ <li>Fie</li>
120
+ <li>Foe</li>
121
+ </ul></li>
122
+ <li>Third</li>
123
+ </ol>
124
+
125
+ <p>Same thing but with paragraphs:</p>
126
+
127
+ <ol>
128
+ <li><p>First</p></li>
129
+ <li><p>Second:</p>
130
+
131
+ <ul>
132
+ <li>Fee</li>
133
+ <li>Fie</li>
134
+ <li>Foe</li>
135
+ </ul></li>
136
+ <li><p>Third</p></li>
137
+ </ol>
138
+
139
+
140
+ <p>This was an error in Markdown 1.0.1:</p>
141
+
142
+ <ul>
143
+ <li><p>this</p>
144
+
145
+ <ul><li>sub</li></ul>
146
+
147
+ <p>that</p></li>
148
+ </ul>
@@ -0,0 +1,131 @@
1
+ ## Unordered
2
+
3
+ Asterisks tight:
4
+
5
+ * asterisk 1
6
+ * asterisk 2
7
+ * asterisk 3
8
+
9
+
10
+ Asterisks loose:
11
+
12
+ * asterisk 1
13
+
14
+ * asterisk 2
15
+
16
+ * asterisk 3
17
+
18
+ * * *
19
+
20
+ Pluses tight:
21
+
22
+ + Plus 1
23
+ + Plus 2
24
+ + Plus 3
25
+
26
+
27
+ Pluses loose:
28
+
29
+ + Plus 1
30
+
31
+ + Plus 2
32
+
33
+ + Plus 3
34
+
35
+ * * *
36
+
37
+
38
+ Minuses tight:
39
+
40
+ - Minus 1
41
+ - Minus 2
42
+ - Minus 3
43
+
44
+
45
+ Minuses loose:
46
+
47
+ - Minus 1
48
+
49
+ - Minus 2
50
+
51
+ - Minus 3
52
+
53
+
54
+ ## Ordered
55
+
56
+ Tight:
57
+
58
+ 1. First
59
+ 2. Second
60
+ 3. Third
61
+
62
+ and:
63
+
64
+ 1. One
65
+ 2. Two
66
+ 3. Three
67
+
68
+
69
+ Loose using tabs:
70
+
71
+ 1. First
72
+
73
+ 2. Second
74
+
75
+ 3. Third
76
+
77
+ and using spaces:
78
+
79
+ 1. One
80
+
81
+ 2. Two
82
+
83
+ 3. Three
84
+
85
+ Multiple paragraphs:
86
+
87
+ 1. Item 1, graf one.
88
+
89
+ Item 2. graf two. The quick brown fox jumped over the lazy dog's
90
+ back.
91
+
92
+ 2. Item 2.
93
+
94
+ 3. Item 3.
95
+
96
+
97
+
98
+ ## Nested
99
+
100
+ * Tab
101
+ * Tab
102
+ * Tab
103
+
104
+ Here's another:
105
+
106
+ 1. First
107
+ 2. Second:
108
+ * Fee
109
+ * Fie
110
+ * Foe
111
+ 3. Third
112
+
113
+ Same thing but with paragraphs:
114
+
115
+ 1. First
116
+
117
+ 2. Second:
118
+ * Fee
119
+ * Fie
120
+ * Foe
121
+
122
+ 3. Third
123
+
124
+
125
+ This was an error in Markdown 1.0.1:
126
+
127
+ * this
128
+
129
+ * sub
130
+
131
+ that
@@ -0,0 +1,7 @@
1
+ <p><strong><em>This is strong and em.</em></strong></p>
2
+
3
+ <p>So is <strong><em>this</em></strong> word.</p>
4
+
5
+ <p><strong><em>This is strong and em.</em></strong></p>
6
+
7
+ <p>So is <strong><em>this</em></strong> word.</p>
@@ -0,0 +1,7 @@
1
+ ***This is strong and em.***
2
+
3
+ So is ***this*** word.
4
+
5
+ ___This is strong and em.___
6
+
7
+ So is ___this___ word.
@@ -0,0 +1,25 @@
1
+ <ul>
2
+ <li><p>this is a list item
3
+ indented with tabs</p></li>
4
+ <li><p>this is a list item
5
+ indented with spaces</p></li>
6
+ </ul>
7
+
8
+ <p>Code:</p>
9
+
10
+ <pre><code>this code block is indented by one tab
11
+ </code></pre>
12
+
13
+ <p>And:</p>
14
+
15
+ <pre><code> this code block is indented by two tabs
16
+ </code></pre>
17
+
18
+ <p>And:</p>
19
+
20
+ <pre><code>+ this is an example list item
21
+ indented with tabs
22
+
23
+ + this is an example list item
24
+ indented with spaces
25
+ </code></pre>
@@ -0,0 +1,21 @@
1
+ + this is a list item
2
+ indented with tabs
3
+
4
+ + this is a list item
5
+ indented with spaces
6
+
7
+ Code:
8
+
9
+ this code block is indented by one tab
10
+
11
+ And:
12
+
13
+ this code block is indented by two tabs
14
+
15
+ And:
16
+
17
+ + this is an example list item
18
+ indented with tabs
19
+
20
+ + this is an example list item
21
+ indented with spaces
@@ -0,0 +1,8 @@
1
+ <blockquote>
2
+ <p>A list within a blockquote:</p>
3
+ <ul>
4
+ <li>asterisk 1</li>
5
+ <li>asterisk 2</li>
6
+ <li>asterisk 3</li>
7
+ </ul>
8
+ </blockquote>
@@ -0,0 +1,5 @@
1
+ > A list within a blockquote:
2
+ >
3
+ > * asterisk 1
4
+ > * asterisk 2
5
+ > * asterisk 3
@@ -0,0 +1,17 @@
1
+ Hi,
2
+
3
+ I'd like to announce the alpha release of a Markdown library for [Ruby][1]
4
+ called "BlueCloth". It's mostly a direct port of the most recent Perl version,
5
+ minus the various plugin hooks and whatnot.
6
+
7
+ More information can be found on [the project page][2], or feel free to ask me
8
+ directly. I don't have much in the way of a demo yet, but will be working on
9
+ getting something set up in the coming days.
10
+
11
+ [1]: http://www.ruby-lang.org/
12
+ [2]: http://bluecloth.rubyforge.org/
13
+
14
+ --
15
+ Michael Granger <ged@FaerieMUD.org>
16
+ Rubymage, Believer, Architect
17
+ The FaerieMUD Consortium <http://www.FaerieMUD.org/>
@@ -0,0 +1,67 @@
1
+ * xx xxxxxxx xx xxxxxx.
2
+
3
+ * xxx xxxxxxx xxxx xx xxxxxxxxxxx xx:
4
+
5
+ * xxxxxxx xxxxxxx: xxxxx xxxx xxxx xxxxxxx xxxxxxx xxxxxxxx xxxxxx xx
6
+ xxxxxxx xxx xxxxxxxxx, xxx x xxxxx xxxxx xxx xxxxxxxx xx xxx xxxxxx xxxx
7
+ xxx xx xxxxxxxxx xx xxxx.
8
+
9
+ xxxxx xxxxxxx xx xxx xxxx xx xx xxxxxxxxx, xxx xxxx xxxxxx xx xxxxxxx xxxx
10
+ xxx xxxxxxx'x xxxxxx xxx. xx xxxxxxxx xxxxxxxxxxxxx xxxxxxxx.
11
+
12
+ * xxxxxxxxx xxxxxxx: xxxxx xxxx xxx xxxxx xx xxxxx xxx xxxxxxxx xxxxxxxxx
13
+ xx xxx xxxxxxxx, xxx xxxxx xxxxx xxxx xxxx xxxxx xxxxxxxxxxxx xx xxx
14
+ xxxxxxxxxxx xxxx xxx xx xxxxxxxxx xx xxxx.
15
+
16
+ xxxxx xxxxxxx xxx xx xxxxxxxxx xxxxxx xxx-xxxx xxxxx (xx xx xxxxxxxxxx)
17
+ xx, xx xxxxxxxxx xxxxxxxx xxxxxxx xx xxxxxxxx xx xxxxxx xxx xxxxxxx
18
+ xxxxxxx xx xxx xxxxxxx, xxxxxx xxx xxxx xxx.
19
+
20
+ xxxxx xxxxxxxxxx xxx xxxx xxxx xx xxxxxxxxx xxx xx xxxxx xxx xxxxx xxxxx
21
+ xxx xxxx xxx xxxx xxxxxxxxx. xxxxxxxx xxxxxxxxxxxxx xxx xxxx-xxxxxxxxx,
22
+ xxxx xx xxxxxx xxx xxxx.
23
+
24
+ * xxxxx xxxxxxx: xxxxx xxxx xxxxxx xxxx xxxxxxx xx xxxxxxx x xxxxxxxxxxx
25
+ xxxxxx, xxxxxxx xx xxxxxxx xxxxxxxxxxxx. xxxxx xxxxxxx xxxx xx xxxxxxxxx
26
+ xxxxxx xxx-xxxx xxxxx.
27
+
28
+ xxxxxx xxxxxxxxx xxx x xxxx xxxxxxxxx, xxxx xx x-xxxx.
29
+
30
+ * xxxx xxx x xxxxxx xxxxxxx xxxx: xxxxx xxxxxxx xxxx xx xxxxxxxx, xxx xxxxxxx
31
+ xxx xxx xxxxxx, xxx xxxxx, xxx xxxxxxxxx xxx xxxxxxx xxxx xxx xxxxxxx
32
+ xxxxxxxx xxxx, xxx xxxx-xxx xxxx, xxx xxxxxxxx xx xxx xxxx, xxx xxx xxxxxxxx
33
+ xx xxx xxxxxxxxx xxxx-xxx.
34
+
35
+ * xxx xxxxxxxxxxxx xxxxxxxxxxx (x.x.x. xxx xxxxxxxx xx xxxxxxx xxxxxxxx, xx
36
+ xxxxxxxx xxxxxx, xxx.), xxx xxxxxxx xxxxxxxxxxx xx x xxxxxx xxxxxxx xxxx
37
+ xxxx xx xxxxxxxxx: x xxxx-xxxxxx xx xxxx-xxxxx xxxxxxxx xx xxx xxxxxxxxxx.
38
+
39
+ * xxx xxx xxxx xxxxxxx xxx, xx xxxxx xxxxxx xx xxxx xx xxx xxxxxxx'x xxxxxx
40
+ xxx. xxxxxxxx xxxxxxx xxxxxx xx xxxx xxx xxxxxxx xxxxxxx.
41
+
42
+ x xxxxxx xxx xxx xxxxxxx xxxx xx xxxx xx xxxxxxxx. xxxxx xxxxxxxxxxxxx
43
+ xxxxxx xx x xxxxxx xxxx xx xxxxxxx xxxx xxxx xxxxxx'x xxxxxx xxx xxx xxxx
44
+ xxxxxxx xxx xxxxxxxxx xxxxxxxxxxx:
45
+
46
+ * xxxxxxxxx xx xxxxxx xxxxxxx xxxxxx xxxx xxxxxx (xx xxxxx xxxxxx xx xx
47
+ xxxxxxxxxx).
48
+
49
+ * xxxxxxxxxxx xx xxxx xxxxxxx xxx.
50
+
51
+ * xxxx xx xxxxx xxxxxxx xx xxx xxxxxx.
52
+
53
+ * xxxx xxx xxxx xx xxxxxx xx xxxx-xx-xx xx:xx xxx (xx xxx) xxxxxx.
54
+
55
+ * xxxx xxx xxxxxxxx xx xxxxxxxxxxx xx xxxxxx.
56
+
57
+ * xxxxxx xx xxxxxxx xxxx xx xxxxxxxx xxxxxxx xxx xxxx xxxx xx xxxxxx
58
+ xxxxx-xxxxxxxxxxxx xxxxxx xxxxxxxxxx xxxxxxx. xxxxxxxx xxxxxxx xxx xx
59
+ xxxxxxxx xx xxxxxxxxxxx xx xxxx xxxx.
60
+
61
+ * xx x xxxxx xxxx:
62
+
63
+ * xxxx xxxxxxx xxxxxx xxxx x xxxxx-xxx xxx xxxxxx xxxxxxx, xxxxxxxx xxxxxxx,
64
+ xxx xxxxxxxx xxxxx xxxxxxx xxxx xxxxxxxx xxxxxxx, xx xxx xxx. xxxxxxx,
65
+ xxxx xxxxxx xxx xxxx xx xxx xxxxxxx xx xxx xxxxxx xx xxx xxxxxxx xxxxxx
66
+ -- xxxxx xxx, xx xxxxx xxxxxx xxxxx xx xxxxx xxx xxxx xxxxxxxx -- xxx xxxx
67
+ xxxxx xxx xxx xxxxxxxx xx xxxxxxxxx xxxxxx-xxxxxxxx xxxxxxxx.