bluecloth 2.0.7-x86-mswin32 → 2.0.11pre158-x86-mswin32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (67) hide show
  1. data.tar.gz.sig +0 -0
  2. data/.gemtest +0 -0
  3. data/History.md +4 -0
  4. data/LICENSE +1 -1
  5. data/Manifest.txt +103 -0
  6. data/README.md +103 -0
  7. data/Rakefile +95 -301
  8. data/ext/VERSION +1 -1
  9. data/ext/bluecloth.c +69 -23
  10. data/ext/bluecloth.h +13 -2
  11. data/ext/config.h +13 -2
  12. data/ext/css.c +14 -5
  13. data/ext/cstring.h +4 -2
  14. data/ext/docheader.c +13 -7
  15. data/ext/emmatch.c +188 -0
  16. data/ext/extconf.rb +7 -9
  17. data/ext/generate.c +333 -293
  18. data/ext/html5.c +24 -0
  19. data/ext/markdown.c +326 -185
  20. data/ext/markdown.h +52 -29
  21. data/ext/mkdio.c +82 -41
  22. data/ext/mkdio.h +44 -23
  23. data/ext/resource.c +4 -2
  24. data/ext/setup.c +47 -0
  25. data/ext/tags.c +123 -0
  26. data/ext/tags.h +19 -0
  27. data/lib/1.8/bluecloth_ext.so +0 -0
  28. data/lib/1.9/bluecloth_ext.so +0 -0
  29. data/lib/bluecloth.rb +77 -42
  30. data/spec/bluecloth/101_changes_spec.rb +18 -21
  31. data/spec/bluecloth/TEMPLATE +36 -0
  32. data/spec/bluecloth/autolinks_spec.rb +4 -7
  33. data/spec/bluecloth/blockquotes_spec.rb +20 -23
  34. data/spec/bluecloth/code_spans_spec.rb +2 -5
  35. data/spec/bluecloth/emphasis_spec.rb +2 -5
  36. data/spec/bluecloth/entities_spec.rb +2 -5
  37. data/spec/bluecloth/hrules_spec.rb +2 -5
  38. data/spec/bluecloth/images_spec.rb +2 -5
  39. data/spec/bluecloth/inline_html_spec.rb +26 -66
  40. data/spec/bluecloth/links_spec.rb +1 -5
  41. data/spec/bluecloth/lists_spec.rb +2 -5
  42. data/spec/bluecloth/paragraphs_spec.rb +2 -5
  43. data/spec/bluecloth/titles_spec.rb +2 -5
  44. data/spec/bluecloth_spec.rb +36 -22
  45. data/spec/bugfix_spec.rb +90 -10
  46. data/spec/contributions_spec.rb +2 -3
  47. data/spec/discount_spec.rb +50 -10
  48. data/spec/lib/helpers.rb +18 -117
  49. data/spec/lib/matchers.rb +7 -18
  50. data/spec/markdowntest_spec.rb +3 -39
  51. metadata +257 -143
  52. metadata.gz.sig +0 -0
  53. data/ChangeLog +0 -387
  54. data/README +0 -81
  55. data/Rakefile.local +0 -41
  56. data/rake/191_compat.rb +0 -26
  57. data/rake/dependencies.rb +0 -76
  58. data/rake/helpers.rb +0 -435
  59. data/rake/hg.rb +0 -273
  60. data/rake/manual.rb +0 -782
  61. data/rake/packaging.rb +0 -123
  62. data/rake/publishing.rb +0 -274
  63. data/rake/rdoc.rb +0 -30
  64. data/rake/style.rb +0 -62
  65. data/rake/svn.rb +0 -668
  66. data/rake/testing.rb +0 -187
  67. data/rake/verifytask.rb +0 -64
@@ -0,0 +1,36 @@
1
+ #!/usr/bin/env ruby
2
+ # encoding: utf-8
3
+
4
+ BEGIN {
5
+ require 'pathname'
6
+ basedir = Pathname.new( __FILE__ ).dirname.parent.parent
7
+
8
+ libdir = basedir + 'lib'
9
+ extdir = basedir + 'ext'
10
+
11
+ $LOAD_PATH.unshift( basedir ) unless $LOAD_PATH.include?( basedir )
12
+ $LOAD_PATH.unshift( libdir ) unless $LOAD_PATH.include?( libdir )
13
+ $LOAD_PATH.unshift( extdir ) unless $LOAD_PATH.include?( extdir )
14
+ }
15
+
16
+ require 'rspec'
17
+ require 'bluecloth'
18
+
19
+ require 'spec/lib/helpers'
20
+
21
+
22
+ #####################################################################
23
+ ### C O N T E X T S
24
+ #####################################################################
25
+
26
+ describe BlueCloth, "" do
27
+
28
+ it "does something cool" do
29
+ the_indented_markdown( <<-"---" ).should be_transformed_into(<<-"---").without_indentation
30
+ ---
31
+ ---
32
+ end
33
+
34
+ end
35
+
36
+
@@ -4,20 +4,19 @@
4
4
  BEGIN {
5
5
  require 'pathname'
6
6
  basedir = Pathname.new( __FILE__ ).dirname.parent.parent
7
-
7
+
8
8
  libdir = basedir + 'lib'
9
9
  extdir = basedir + 'ext'
10
-
10
+
11
+ $LOAD_PATH.unshift( basedir ) unless $LOAD_PATH.include?( basedir )
11
12
  $LOAD_PATH.unshift( libdir ) unless $LOAD_PATH.include?( libdir )
12
13
  $LOAD_PATH.unshift( extdir ) unless $LOAD_PATH.include?( extdir )
13
14
  }
14
15
 
15
- require 'spec'
16
+ require 'rspec'
16
17
  require 'bluecloth'
17
18
 
18
19
  require 'spec/lib/helpers'
19
- require 'spec/lib/constants'
20
- require 'spec/lib/matchers'
21
20
 
22
21
 
23
22
  #####################################################################
@@ -25,8 +24,6 @@ require 'spec/lib/matchers'
25
24
  #####################################################################
26
25
 
27
26
  describe BlueCloth, "auto-links" do
28
- include BlueCloth::TestConstants,
29
- BlueCloth::Matchers
30
27
 
31
28
  it "supports HTTP auto-links" do
32
29
  the_indented_markdown( <<-"---" ).should be_transformed_into(<<-"---").without_indentation
@@ -4,20 +4,19 @@
4
4
  BEGIN {
5
5
  require 'pathname'
6
6
  basedir = Pathname.new( __FILE__ ).dirname.parent.parent
7
-
7
+
8
8
  libdir = basedir + 'lib'
9
9
  extdir = basedir + 'ext'
10
-
10
+
11
+ $LOAD_PATH.unshift( basedir ) unless $LOAD_PATH.include?( basedir )
11
12
  $LOAD_PATH.unshift( libdir ) unless $LOAD_PATH.include?( libdir )
12
13
  $LOAD_PATH.unshift( extdir ) unless $LOAD_PATH.include?( extdir )
13
14
  }
14
15
 
15
- require 'spec'
16
+ require 'rspec'
16
17
  require 'bluecloth'
17
18
 
18
19
  require 'spec/lib/helpers'
19
- require 'spec/lib/constants'
20
- require 'spec/lib/matchers'
21
20
 
22
21
 
23
22
  #####################################################################
@@ -25,8 +24,6 @@ require 'spec/lib/matchers'
25
24
  #####################################################################
26
25
 
27
26
  describe BlueCloth, "blockquotes" do
28
- include BlueCloth::TestConstants,
29
- BlueCloth::Matchers
30
27
 
31
28
  ### [Blockquotes]
32
29
 
@@ -71,14 +68,14 @@ describe BlueCloth, "blockquotes" do
71
68
  > This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet,
72
69
  consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus.
73
70
  Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus.
74
-
71
+
75
72
  > Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse
76
73
  id sem consectetuer libero luctus adipiscing.
77
74
  ---
78
75
  <blockquote><p>This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet,
79
76
  consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus.
80
77
  Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus.</p>
81
-
78
+
82
79
  <p>Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse
83
80
  id sem consectetuer libero luctus adipiscing.</p></blockquote>
84
81
  ---
@@ -89,30 +86,30 @@ describe BlueCloth, "blockquotes" do
89
86
  it "supports other Markdown elements in blockquote sections" do
90
87
  the_indented_markdown( <<-"---" ).should be_transformed_into(<<-"---").without_indentation
91
88
  > ## This is a header.
92
- >
89
+ >
93
90
  > 1. This is the first list item.
94
91
  > 2. This is the second list item.
95
- >
92
+ >
96
93
  > Here's some example code:
97
- >
94
+ >
98
95
  > return shell_exec("echo $input | $markdown_script");
99
96
  ---
100
97
  <blockquote><h2>This is a header.</h2>
101
-
98
+
102
99
  <ol>
103
- <li>This is the first list item.</li>
104
- <li>This is the second list item.</li>
100
+ <li> This is the first list item.</li>
101
+ <li> This is the second list item.</li>
105
102
  </ol>
106
-
103
+
107
104
  <p>Here's some example code:</p>
108
-
105
+
109
106
  <pre><code>return shell_exec("echo $input | $markdown_script");
110
107
  </code></pre></blockquote>
111
108
  ---
112
109
  end
113
110
 
114
111
  # Blockquotes with a <pre> section
115
- it "supports block-level HTML inside of blockquotes" do
112
+ it "supports block-level HTML inside of blockquotes", :pedantic => true do
116
113
  pending "a fix in Discount" do
117
114
  the_indented_markdown( <<-"---" ).should be_transformed_into(<<-"---").without_indentation
118
115
  > The best approximation of the problem is the following code:
@@ -120,19 +117,19 @@ describe BlueCloth, "blockquotes" do
120
117
  > <pre>
121
118
  > foo + bar; foo.factorize; foo.display
122
119
  > </pre>
123
- >
120
+ >
124
121
  > This should result in an error on any little-endian platform.
125
- >
122
+ >
126
123
  > <div>- Garrick Mettronne</div>
127
124
  ---
128
125
  <blockquote><p>The best approximation of the problem is the following code:</p>
129
-
126
+
130
127
  <pre>
131
128
  foo + bar; foo.factorize; foo.display
132
129
  </pre>
133
-
130
+
134
131
  <p>This should result in an error on any little-endian platform.</p>
135
-
132
+
136
133
  <div>- Garrick Mettronne</div>
137
134
  </blockquote>
138
135
  ---
@@ -8,16 +8,15 @@ BEGIN {
8
8
  libdir = basedir + 'lib'
9
9
  extdir = basedir + 'ext'
10
10
 
11
+ $LOAD_PATH.unshift( basedir ) unless $LOAD_PATH.include?( basedir )
11
12
  $LOAD_PATH.unshift( libdir ) unless $LOAD_PATH.include?( libdir )
12
13
  $LOAD_PATH.unshift( extdir ) unless $LOAD_PATH.include?( extdir )
13
14
  }
14
15
 
15
- require 'spec'
16
+ require 'rspec'
16
17
  require 'bluecloth'
17
18
 
18
19
  require 'spec/lib/helpers'
19
- require 'spec/lib/constants'
20
- require 'spec/lib/matchers'
21
20
 
22
21
 
23
22
  #####################################################################
@@ -25,8 +24,6 @@ require 'spec/lib/matchers'
25
24
  #####################################################################
26
25
 
27
26
  describe BlueCloth, "that contains code blocks or spans" do
28
- include BlueCloth::TestConstants,
29
- BlueCloth::Matchers
30
27
 
31
28
  it "wraps CODE tags around backticked spans" do
32
29
  the_indented_markdown( <<-"---" ).should be_transformed_into(<<-"---").without_indentation
@@ -8,16 +8,15 @@ BEGIN {
8
8
  libdir = basedir + 'lib'
9
9
  extdir = basedir + 'ext'
10
10
 
11
+ $LOAD_PATH.unshift( basedir ) unless $LOAD_PATH.include?( basedir )
11
12
  $LOAD_PATH.unshift( libdir ) unless $LOAD_PATH.include?( libdir )
12
13
  $LOAD_PATH.unshift( extdir ) unless $LOAD_PATH.include?( extdir )
13
14
  }
14
15
 
15
- require 'spec'
16
+ require 'rspec'
16
17
  require 'bluecloth'
17
18
 
18
19
  require 'spec/lib/helpers'
19
- require 'spec/lib/constants'
20
- require 'spec/lib/matchers'
21
20
 
22
21
 
23
22
  #####################################################################
@@ -25,8 +24,6 @@ require 'spec/lib/matchers'
25
24
  #####################################################################
26
25
 
27
26
  describe BlueCloth, "emphasis" do
28
- include BlueCloth::TestConstants,
29
- BlueCloth::Matchers
30
27
 
31
28
  it "treats single asterisks as indicators of emphasis" do
32
29
  the_indented_markdown( <<-"---" ).should be_transformed_into(<<-"---").without_indentation
@@ -8,16 +8,15 @@ BEGIN {
8
8
  libdir = basedir + 'lib'
9
9
  extdir = basedir + 'ext'
10
10
 
11
+ $LOAD_PATH.unshift( basedir ) unless $LOAD_PATH.include?( basedir )
11
12
  $LOAD_PATH.unshift( libdir ) unless $LOAD_PATH.include?( libdir )
12
13
  $LOAD_PATH.unshift( extdir ) unless $LOAD_PATH.include?( extdir )
13
14
  }
14
15
 
15
- require 'spec'
16
+ require 'rspec'
16
17
  require 'bluecloth'
17
18
 
18
19
  require 'spec/lib/helpers'
19
- require 'spec/lib/constants'
20
- require 'spec/lib/matchers'
21
20
 
22
21
 
23
22
  #####################################################################
@@ -25,8 +24,6 @@ require 'spec/lib/matchers'
25
24
  #####################################################################
26
25
 
27
26
  describe BlueCloth, "document with entities" do
28
- include BlueCloth::TestConstants,
29
- BlueCloth::Matchers
30
27
 
31
28
  it "escapes special characters" do
32
29
  the_indented_markdown( <<-"---" ).should be_transformed_into(<<-"---").without_indentation
@@ -8,16 +8,15 @@ BEGIN {
8
8
  libdir = basedir + 'lib'
9
9
  extdir = basedir + 'ext'
10
10
 
11
+ $LOAD_PATH.unshift( basedir ) unless $LOAD_PATH.include?( basedir )
11
12
  $LOAD_PATH.unshift( libdir ) unless $LOAD_PATH.include?( libdir )
12
13
  $LOAD_PATH.unshift( extdir ) unless $LOAD_PATH.include?( extdir )
13
14
  }
14
15
 
15
- require 'spec'
16
+ require 'rspec'
16
17
  require 'bluecloth'
17
18
 
18
19
  require 'spec/lib/helpers'
19
- require 'spec/lib/constants'
20
- require 'spec/lib/matchers'
21
20
 
22
21
 
23
22
  #####################################################################
@@ -25,8 +24,6 @@ require 'spec/lib/matchers'
25
24
  #####################################################################
26
25
 
27
26
  describe BlueCloth, "horizontal rules" do
28
- include BlueCloth::TestConstants,
29
- BlueCloth::Matchers
30
27
 
31
28
  # Hrule -- three asterisks
32
29
  it "produces a horizontal rule tag from three asterisks on a line by themselves" do
@@ -8,16 +8,15 @@ BEGIN {
8
8
  libdir = basedir + 'lib'
9
9
  extdir = basedir + 'ext'
10
10
 
11
+ $LOAD_PATH.unshift( basedir ) unless $LOAD_PATH.include?( basedir )
11
12
  $LOAD_PATH.unshift( libdir ) unless $LOAD_PATH.include?( libdir )
12
13
  $LOAD_PATH.unshift( extdir ) unless $LOAD_PATH.include?( extdir )
13
14
  }
14
15
 
15
- require 'spec'
16
+ require 'rspec'
16
17
  require 'bluecloth'
17
18
 
18
19
  require 'spec/lib/helpers'
19
- require 'spec/lib/constants'
20
- require 'spec/lib/matchers'
21
20
 
22
21
 
23
22
  #####################################################################
@@ -25,8 +24,6 @@ require 'spec/lib/matchers'
25
24
  #####################################################################
26
25
 
27
26
  describe BlueCloth, "images" do
28
- include BlueCloth::TestConstants,
29
- BlueCloth::Matchers
30
27
 
31
28
  ### [Images]
32
29
 
@@ -8,16 +8,15 @@ BEGIN {
8
8
  libdir = basedir + 'lib'
9
9
  extdir = basedir + 'ext'
10
10
 
11
+ $LOAD_PATH.unshift( basedir ) unless $LOAD_PATH.include?( basedir )
11
12
  $LOAD_PATH.unshift( libdir ) unless $LOAD_PATH.include?( libdir )
12
13
  $LOAD_PATH.unshift( extdir ) unless $LOAD_PATH.include?( extdir )
13
14
  }
14
15
 
15
- require 'spec'
16
+ require 'rspec'
16
17
  require 'bluecloth'
17
18
 
18
19
  require 'spec/lib/helpers'
19
- require 'spec/lib/constants'
20
- require 'spec/lib/matchers'
21
20
 
22
21
 
23
22
  #####################################################################
@@ -25,8 +24,6 @@ require 'spec/lib/matchers'
25
24
  #####################################################################
26
25
 
27
26
  describe BlueCloth, "document with inline HTML" do
28
- include BlueCloth::TestConstants,
29
- BlueCloth::Matchers
30
27
 
31
28
  it "preserves TABLE block" do
32
29
  the_indented_markdown( <<-"---" ).should be_transformed_into(<<-"---").without_indentation
@@ -123,67 +120,6 @@ describe BlueCloth, "document with inline HTML" do
123
120
  end
124
121
 
125
122
 
126
- it "preserves MathML block" do
127
- pending "discount doesn't support this, it explicitly matches block-level HTML elements only"
128
- the_indented_markdown( <<-"---" ).should be_transformed_into(<<-"---").without_indentation
129
- Examples
130
- --------
131
-
132
- Now that we have met some of the key players, it is time to see what we can
133
- do. Here are some examples and comments which illustrate the use of the basic
134
- layout and token elements. Consider the expression x2 + 4x + 4 = 0. A basic
135
- MathML presentation encoding for this would be:
136
-
137
- <math>
138
- <mrow>
139
- <msup>
140
- <mi>x</mi>
141
- <mn>2</mn>
142
- </msup>
143
- <mo>+</mo>
144
- <mn>4</mn>
145
- <mi>x</mi>
146
- <mo>+</mo>
147
- <mn>4</mn>
148
- <mo>=</mo>
149
- <mn>0</mn>
150
- </mrow>
151
- </math>
152
-
153
- This encoding will display as you would expect. However, if we were interested
154
- in reusing this expression in unknown situations, we would likely want to spend
155
- a little more effort analyzing and encoding the logical expression structure.
156
- ---
157
- <h2>Examples</h2>
158
-
159
- <p>Now that we have met some of the key players, it is time to see what we can
160
- do. Here are some examples and comments which illustrate the use of the basic
161
- layout and token elements. Consider the expression x2 + 4x + 4 = 0. A basic
162
- MathML presentation encoding for this would be:</p>
163
-
164
- <math>
165
- <mrow>
166
- <msup>
167
- <mi>x</mi>
168
- <mn>2</mn>
169
- </msup>
170
- <mo>+</mo>
171
- <mn>4</mn>
172
- <mi>x</mi>
173
- <mo>+</mo>
174
- <mn>4</mn>
175
- <mo>=</mo>
176
- <mn>0</mn>
177
- </mrow>
178
- </math>
179
-
180
- <p>This encoding will display as you would expect. However, if we were interested
181
- in reusing this expression in unknown situations, we would likely want to spend
182
- a little more effort analyzing and encoding the logical expression structure.</p>
183
- ---
184
- end
185
-
186
-
187
123
  it "preserves span-level HTML" do
188
124
  the_indented_markdown( <<-"---" ).should be_transformed_into(<<-"---").without_indentation
189
125
  This is some stuff with a <span class="foo">spanned bit of text</span> in
@@ -232,6 +168,30 @@ describe BlueCloth, "document with inline HTML" do
232
168
  ---
233
169
  end
234
170
 
171
+ it "preserves HTML5 tags" do
172
+ the_indented_markdown( <<-"---" ).should be_transformed_into(<<-"---").without_indentation
173
+ <aside>
174
+ <p>This is a sidebar that explains some stuff.</p>
175
+ </aside>
176
+
177
+ The main content.
178
+
179
+ <footer>
180
+ <p>Copyright &copy; 2010 by J. Random Hacker.</p>
181
+ </footer>
182
+ ---
183
+ <aside>
184
+ <p>This is a sidebar that explains some stuff.</p>
185
+ </aside>
186
+
187
+ <p>The main content.</p>
188
+
189
+ <footer>
190
+ <p>Copyright &copy; 2010 by J. Random Hacker.</p>
191
+ </footer>
192
+ ---
193
+ end
194
+
235
195
 
236
196
  end
237
197