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.
- data.tar.gz.sig +0 -0
- data/.gemtest +0 -0
- data/History.md +4 -0
- data/LICENSE +1 -1
- data/Manifest.txt +103 -0
- data/README.md +103 -0
- data/Rakefile +95 -301
- data/ext/VERSION +1 -1
- data/ext/bluecloth.c +69 -23
- data/ext/bluecloth.h +13 -2
- data/ext/config.h +13 -2
- data/ext/css.c +14 -5
- data/ext/cstring.h +4 -2
- data/ext/docheader.c +13 -7
- data/ext/emmatch.c +188 -0
- data/ext/extconf.rb +7 -9
- data/ext/generate.c +333 -293
- data/ext/html5.c +24 -0
- data/ext/markdown.c +326 -185
- data/ext/markdown.h +52 -29
- data/ext/mkdio.c +82 -41
- data/ext/mkdio.h +44 -23
- data/ext/resource.c +4 -2
- data/ext/setup.c +47 -0
- data/ext/tags.c +123 -0
- data/ext/tags.h +19 -0
- data/lib/1.8/bluecloth_ext.so +0 -0
- data/lib/1.9/bluecloth_ext.so +0 -0
- data/lib/bluecloth.rb +77 -42
- data/spec/bluecloth/101_changes_spec.rb +18 -21
- data/spec/bluecloth/TEMPLATE +36 -0
- data/spec/bluecloth/autolinks_spec.rb +4 -7
- data/spec/bluecloth/blockquotes_spec.rb +20 -23
- data/spec/bluecloth/code_spans_spec.rb +2 -5
- data/spec/bluecloth/emphasis_spec.rb +2 -5
- data/spec/bluecloth/entities_spec.rb +2 -5
- data/spec/bluecloth/hrules_spec.rb +2 -5
- data/spec/bluecloth/images_spec.rb +2 -5
- data/spec/bluecloth/inline_html_spec.rb +26 -66
- data/spec/bluecloth/links_spec.rb +1 -5
- data/spec/bluecloth/lists_spec.rb +2 -5
- data/spec/bluecloth/paragraphs_spec.rb +2 -5
- data/spec/bluecloth/titles_spec.rb +2 -5
- data/spec/bluecloth_spec.rb +36 -22
- data/spec/bugfix_spec.rb +90 -10
- data/spec/contributions_spec.rb +2 -3
- data/spec/discount_spec.rb +50 -10
- data/spec/lib/helpers.rb +18 -117
- data/spec/lib/matchers.rb +7 -18
- data/spec/markdowntest_spec.rb +3 -39
- metadata +257 -143
- metadata.gz.sig +0 -0
- data/ChangeLog +0 -387
- data/README +0 -81
- data/Rakefile.local +0 -41
- data/rake/191_compat.rb +0 -26
- data/rake/dependencies.rb +0 -76
- data/rake/helpers.rb +0 -435
- data/rake/hg.rb +0 -273
- data/rake/manual.rb +0 -782
- data/rake/packaging.rb +0 -123
- data/rake/publishing.rb +0 -274
- data/rake/rdoc.rb +0 -30
- data/rake/style.rb +0 -62
- data/rake/svn.rb +0 -668
- data/rake/testing.rb +0 -187
- data/rake/verifytask.rb +0 -64
@@ -12,12 +12,10 @@ BEGIN {
|
|
12
12
|
$LOAD_PATH.unshift( extdir ) unless $LOAD_PATH.include?( extdir )
|
13
13
|
}
|
14
14
|
|
15
|
-
require '
|
15
|
+
require 'rspec'
|
16
16
|
require 'bluecloth'
|
17
17
|
|
18
18
|
require 'spec/lib/helpers'
|
19
|
-
require 'spec/lib/constants'
|
20
|
-
require 'spec/lib/matchers'
|
21
19
|
|
22
20
|
|
23
21
|
#####################################################################
|
@@ -25,8 +23,6 @@ require 'spec/lib/matchers'
|
|
25
23
|
#####################################################################
|
26
24
|
|
27
25
|
describe BlueCloth, "links" do
|
28
|
-
include BlueCloth::TestConstants,
|
29
|
-
BlueCloth::Matchers
|
30
26
|
|
31
27
|
it "supports inline links" do
|
32
28
|
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 '
|
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, "lists" do
|
28
|
-
include BlueCloth::TestConstants,
|
29
|
-
BlueCloth::Matchers
|
30
27
|
|
31
28
|
it "support unordered lists with asterisk bullets" 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 '
|
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 paragraphs" do
|
28
|
-
include BlueCloth::TestConstants,
|
29
|
-
BlueCloth::Matchers
|
30
27
|
|
31
28
|
it "wraps them in P tags" 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 '
|
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, "titles" do
|
28
|
-
include BlueCloth::TestConstants,
|
29
|
-
BlueCloth::Matchers
|
30
27
|
|
31
28
|
# setext-style h1 -- three characters
|
32
29
|
it "transforms Setext-style level-one headers (three equals) into an H1" do
|
data/spec/bluecloth_spec.rb
CHANGED
@@ -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 '
|
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
|
### Output some debugging if $DEBUG is true
|
@@ -118,7 +117,7 @@ describe BlueCloth do
|
|
118
117
|
you might want to prevent.
|
119
118
|
---
|
120
119
|
<p>This is an example
|
121
|
-
[of something](javascript:
|
120
|
+
[of something](javascript:do<em>something</em>bad())
|
122
121
|
you might want to prevent.</p>
|
123
122
|
---
|
124
123
|
end
|
@@ -152,7 +151,7 @@ describe BlueCloth do
|
|
152
151
|
|
153
152
|
it "correctly expands id: links when :pseudoprotocols are enabled" do
|
154
153
|
input = "It was [just as he said](id:foo) it would be."
|
155
|
-
expected = %{<p>It was <
|
154
|
+
expected = %{<p>It was <span id="foo">just as he said</span> it would be.</p>}
|
156
155
|
|
157
156
|
the_markdown( input, :pseudoprotocols => true ).should be_transformed_into( expected )
|
158
157
|
end
|
@@ -173,30 +172,30 @@ describe BlueCloth do
|
|
173
172
|
|
174
173
|
it "correctly adds IDs to headers when :header_labels is enabled" do
|
175
174
|
input = %{# A header\n\nSome stuff\n\n## Another header\n\nMore stuff.\n\n}
|
176
|
-
expected = %{<
|
177
|
-
%{<
|
175
|
+
expected = %{<a name=\"A.header\"></a>\n<h1>A header</h1>\n\n<p>Some stuff</p>\n\n} +
|
176
|
+
%{<a name=\"Another.header\"></a>\n<h2>Another header</h2>\n\n<p>More stuff.</p>}
|
178
177
|
|
179
178
|
the_markdown( input, :header_labels => true ).should be_transformed_into( expected )
|
180
179
|
end
|
181
180
|
|
182
|
-
it "expands superscripts when :
|
181
|
+
it "expands superscripts only when :superscript is enabled" do
|
183
182
|
input = %{It used to be that E = mc^2 used to be the province of physicists.}
|
184
183
|
expected = %{<p>It used to be that E = mc<sup>2</sup> used to be the province} +
|
185
184
|
%{ of physicists.</p>}
|
186
|
-
|
185
|
+
disabled = %{<p>It used to be that E = mc^2 used to be the province} +
|
187
186
|
%{ of physicists.</p>}
|
188
187
|
|
189
|
-
the_markdown( input, :
|
190
|
-
the_markdown( input, :
|
188
|
+
the_markdown( input, :superscript => false ).should be_transformed_into( disabled )
|
189
|
+
the_markdown( input, :superscript => true ).should be_transformed_into( expected )
|
191
190
|
end
|
192
191
|
|
193
|
-
it "uses relaxed emphasis when :
|
192
|
+
it "uses relaxed emphasis when :relaxed is enabled" do
|
194
193
|
input = %{If you use size_t instead, you _won't_ have to worry as much about portability.}
|
195
|
-
|
194
|
+
relaxed = %{<p>If you use size_t instead, you <em>won't</em> have to worry as much about portability.</p>}
|
196
195
|
strict = %{<p>If you use size<em>t instead, you </em>won't_ have to worry as much about portability.</p>}
|
197
196
|
|
198
|
-
the_markdown( input, :
|
199
|
-
the_markdown( input, :
|
197
|
+
the_markdown( input, :relaxed => true ).should be_transformed_into( relaxed )
|
198
|
+
the_markdown( input, :relaxed => false ).should be_transformed_into( strict )
|
200
199
|
end
|
201
200
|
|
202
201
|
end
|
@@ -260,7 +259,7 @@ describe BlueCloth do
|
|
260
259
|
end
|
261
260
|
|
262
261
|
|
263
|
-
describe "encoding under Ruby 1.9.x" do
|
262
|
+
describe "encoding under Ruby 1.9.x", :ruby_19_only => true do
|
264
263
|
|
265
264
|
before( :each ) do
|
266
265
|
pending "only valid under a version of Ruby that has the Encoding class" unless
|
@@ -268,14 +267,29 @@ describe BlueCloth do
|
|
268
267
|
end
|
269
268
|
|
270
269
|
|
271
|
-
it "outputs HTML in
|
272
|
-
|
273
|
-
|
274
|
-
out = BlueCloth.new( utf8 ).to_html
|
270
|
+
it "outputs HTML in UTF8 if given a UTF8 string" do
|
271
|
+
input = "a ∫‡®îñg".encode( Encoding::UTF_8 )
|
272
|
+
output = BlueCloth.new( input ).to_html
|
275
273
|
|
276
|
-
|
277
|
-
|
274
|
+
output.encoding.should == Encoding::UTF_8
|
275
|
+
end
|
276
|
+
|
277
|
+
it "outputs HTML in KOI8-U if given a KOI8-U string" do
|
278
|
+
input = "Почему Молчишь".encode( Encoding::KOI8_U )
|
279
|
+
output = BlueCloth.new( input ).to_html
|
280
|
+
|
281
|
+
output.should == "<p>\xF0\xCF\xDE\xC5\xCD\xD5 \xED\xCF\xCC\xDE\xC9\xDB\xD8</p>".
|
282
|
+
force_encoding( Encoding::KOI8_U )
|
278
283
|
end
|
284
|
+
|
285
|
+
it "outputs HTML in Shift-JIS if given a Shift-JIS string" do
|
286
|
+
input = "日本語".encode( Encoding::SHIFT_JIS )
|
287
|
+
output = BlueCloth.new( input ).to_html
|
288
|
+
|
289
|
+
output.should == "<p>\x93\xFA\x96{\x8C\xEA</p>".
|
290
|
+
force_encoding( Encoding::SHIFT_JIS )
|
291
|
+
end
|
292
|
+
|
279
293
|
end
|
280
294
|
|
281
295
|
end
|
data/spec/bugfix_spec.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
+
# coding: utf-8
|
2
3
|
|
3
4
|
BEGIN {
|
4
5
|
require 'pathname'
|
@@ -7,17 +8,16 @@ BEGIN {
|
|
7
8
|
libdir = basedir + 'lib'
|
8
9
|
extdir = basedir + 'ext'
|
9
10
|
|
11
|
+
$LOAD_PATH.unshift( basedir ) unless $LOAD_PATH.include?( basedir )
|
10
12
|
$LOAD_PATH.unshift( libdir ) unless $LOAD_PATH.include?( libdir )
|
11
13
|
$LOAD_PATH.unshift( extdir ) unless $LOAD_PATH.include?( extdir )
|
12
14
|
}
|
13
15
|
|
14
|
-
require '
|
15
|
-
require 'spec'
|
16
|
-
require 'bluecloth'
|
16
|
+
require 'timeout'
|
17
17
|
|
18
|
+
require 'rspec'
|
18
19
|
require 'spec/lib/helpers'
|
19
|
-
require '
|
20
|
-
require 'spec/lib/matchers'
|
20
|
+
require 'bluecloth'
|
21
21
|
|
22
22
|
|
23
23
|
#####################################################################
|
@@ -37,14 +37,14 @@ describe BlueCloth, "bugfixes" do
|
|
37
37
|
|
38
38
|
### Test to be sure the README file can be transformed.
|
39
39
|
it "can transform the included README file" do
|
40
|
-
readme = @basedir + 'README'
|
40
|
+
readme = @basedir + 'README.md'
|
41
41
|
contents = readme.read
|
42
42
|
|
43
43
|
bcobj = BlueCloth::new( contents )
|
44
44
|
|
45
|
-
|
45
|
+
expect {
|
46
46
|
timeout( 2 ) { bcobj.to_html }
|
47
|
-
|
47
|
+
}.to_not raise_error()
|
48
48
|
end
|
49
49
|
|
50
50
|
|
@@ -157,14 +157,94 @@ describe BlueCloth, "bugfixes" do
|
|
157
157
|
<ul>
|
158
158
|
<li><p>testing</p>
|
159
159
|
|
160
|
-
<pre><code>pre
|
160
|
+
<pre><code> pre
|
161
161
|
</code></pre>
|
162
162
|
|
163
|
-
<p>more li</p></li>
|
163
|
+
<p> more li</p></li>
|
164
164
|
</ul>
|
165
165
|
END_HTML
|
166
166
|
end
|
167
167
|
|
168
|
+
it "renders heading with trailing spaces correctly (#67)" do
|
169
|
+
the_indented_markdown( <<-"END_MARKDOWN" ).should be_transformed_into(<<-"END_HTML").without_indentation
|
170
|
+
The Ant-Sugar Tales
|
171
|
+
===================
|
172
|
+
|
173
|
+
By Candice Yellowflower
|
174
|
+
|
175
|
+
Use of Metaphor
|
176
|
+
---------------
|
177
|
+
|
178
|
+
The author's splendid...
|
179
|
+
END_MARKDOWN
|
180
|
+
<h1>The Ant-Sugar Tales </h1>
|
181
|
+
|
182
|
+
<p>By Candice Yellowflower</p>
|
183
|
+
|
184
|
+
<h2>Use of Metaphor </h2>
|
185
|
+
|
186
|
+
<p>The author's splendid...</p>
|
187
|
+
END_HTML
|
188
|
+
end
|
189
|
+
|
190
|
+
it "renders the example from #68 correctly" do
|
191
|
+
the_indented_markdown( <<-"END_MARKDOWN" ).should be_transformed_into(<<-"END_HTML").without_indentation
|
192
|
+
START example
|
193
|
+
|
194
|
+
1. ö
|
195
|
+
1. ü
|
196
|
+
1. ó
|
197
|
+
1. ő
|
198
|
+
1. ú
|
199
|
+
1. é
|
200
|
+
1. á
|
201
|
+
1. ű
|
202
|
+
1. í
|
203
|
+
|
204
|
+
- ö
|
205
|
+
- ü
|
206
|
+
- ó
|
207
|
+
- ő
|
208
|
+
- ú
|
209
|
+
- é
|
210
|
+
- á
|
211
|
+
- ű
|
212
|
+
- í
|
213
|
+
|
214
|
+
END example
|
215
|
+
END_MARKDOWN
|
216
|
+
<p>START example</p>
|
217
|
+
|
218
|
+
<ol>
|
219
|
+
<li>ö</li>
|
220
|
+
<li>ü</li>
|
221
|
+
<li>ó</li>
|
222
|
+
<li>ő</li>
|
223
|
+
<li>ú</li>
|
224
|
+
<li>é</li>
|
225
|
+
<li>á</li>
|
226
|
+
<li>ű</li>
|
227
|
+
<li><p>í</p></li>
|
228
|
+
<li><p>ö</p></li>
|
229
|
+
<li>ü</li>
|
230
|
+
<li>ó</li>
|
231
|
+
<li>ő</li>
|
232
|
+
<li>ú</li>
|
233
|
+
<li>é</li>
|
234
|
+
<li>á</li>
|
235
|
+
<li>ű</li>
|
236
|
+
<li>í</li>
|
237
|
+
</ol>
|
238
|
+
|
239
|
+
<p>END example</p>
|
240
|
+
END_HTML
|
241
|
+
end
|
242
|
+
|
243
|
+
it "renders alignments in code blocks without changing indentation (#71)" do
|
244
|
+
the_indented_markdown( " Самообучение\n Bugaga\n" ).
|
245
|
+
should be_transformed_into( "<pre><code>Самообучение\nBugaga\n</code></pre>" )
|
246
|
+
end
|
247
|
+
|
168
248
|
end
|
169
249
|
|
170
250
|
|
data/spec/contributions_spec.rb
CHANGED
@@ -7,17 +7,16 @@ BEGIN {
|
|
7
7
|
libdir = basedir + 'lib'
|
8
8
|
extdir = basedir + 'ext'
|
9
9
|
|
10
|
+
$LOAD_PATH.unshift( basedir ) unless $LOAD_PATH.include?( basedir )
|
10
11
|
$LOAD_PATH.unshift( libdir ) unless $LOAD_PATH.include?( libdir )
|
11
12
|
$LOAD_PATH.unshift( extdir ) unless $LOAD_PATH.include?( extdir )
|
12
13
|
}
|
13
14
|
|
14
15
|
require 'rubygems'
|
15
|
-
require '
|
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
|
#####################################################################
|
data/spec/discount_spec.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
+
#coding: utf-8
|
2
3
|
|
3
4
|
BEGIN {
|
4
5
|
require 'pathname'
|
@@ -7,17 +8,16 @@ BEGIN {
|
|
7
8
|
libdir = basedir + 'lib'
|
8
9
|
extdir = basedir + 'ext'
|
9
10
|
|
11
|
+
$LOAD_PATH.unshift( basedir ) unless $LOAD_PATH.include?( basedir )
|
10
12
|
$LOAD_PATH.unshift( libdir ) unless $LOAD_PATH.include?( libdir )
|
11
13
|
$LOAD_PATH.unshift( extdir ) unless $LOAD_PATH.include?( extdir )
|
12
14
|
}
|
13
15
|
|
14
16
|
require 'rubygems'
|
15
|
-
require '
|
17
|
+
require 'rspec'
|
16
18
|
require 'bluecloth'
|
17
19
|
|
18
20
|
require 'spec/lib/helpers'
|
19
|
-
require 'spec/lib/constants'
|
20
|
-
require 'spec/lib/matchers'
|
21
21
|
|
22
22
|
|
23
23
|
#####################################################################
|
@@ -25,8 +25,6 @@ require 'spec/lib/matchers'
|
|
25
25
|
#####################################################################
|
26
26
|
|
27
27
|
describe BlueCloth, "implementation of Discount-specific features" do
|
28
|
-
include BlueCloth::TestConstants,
|
29
|
-
BlueCloth::Matchers
|
30
28
|
|
31
29
|
before( :all ) do
|
32
30
|
@basedir = Pathname.new( __FILE__ ).dirname.parent
|
@@ -46,7 +44,7 @@ describe BlueCloth, "implementation of Discount-specific features" do
|
|
46
44
|
|
47
45
|
it "renders id: links as anchors with an ID" do
|
48
46
|
the_markdown( "[foo](id:bar)", :pseudoprotocols => true ).
|
49
|
-
should be_transformed_into( '<p><
|
47
|
+
should be_transformed_into( '<p><span id="bar">foo</span></p>' )
|
50
48
|
end
|
51
49
|
|
52
50
|
it "renders class: links as SPANs with a CLASS" do
|
@@ -59,13 +57,30 @@ describe BlueCloth, "implementation of Discount-specific features" do
|
|
59
57
|
should be_transformed_into( '<p>bar</p>' )
|
60
58
|
end
|
61
59
|
|
60
|
+
it "renders lang: links as language-specified blocks" do
|
61
|
+
the_markdown( "[gift](lang:de)", :pseudoprotocols => true ).
|
62
|
+
should be_transformed_into( '<p><span lang="de">gift</span></p>' )
|
63
|
+
end
|
64
|
+
|
62
65
|
end
|
63
66
|
|
64
67
|
|
65
68
|
describe "Markdown-Extra tables" do
|
66
69
|
|
70
|
+
it "doesn't try to render tables if :tables isn't set" do
|
71
|
+
the_indented_markdown( <<-"END_MARKDOWN" ).should be_transformed_into(<<-"END_HTML").without_indentation
|
72
|
+
a | b
|
73
|
+
-----|-----
|
74
|
+
hello|sailor
|
75
|
+
END_MARKDOWN
|
76
|
+
<p> a | b
|
77
|
+
-----|-----
|
78
|
+
hello|sailor</p>
|
79
|
+
END_HTML
|
80
|
+
end
|
81
|
+
|
67
82
|
it "renders the example from orc's blog" do
|
68
|
-
the_indented_markdown( <<-"END_MARKDOWN", :
|
83
|
+
the_indented_markdown( <<-"END_MARKDOWN", :tables => true ).should be_transformed_into(<<-"END_HTML").without_indentation
|
69
84
|
a | b
|
70
85
|
-----|-----
|
71
86
|
hello|sailor
|
@@ -88,7 +103,7 @@ describe BlueCloth, "implementation of Discount-specific features" do
|
|
88
103
|
end
|
89
104
|
|
90
105
|
it "renders simple markdown-extra tables" do
|
91
|
-
the_indented_markdown( <<-"END_MARKDOWN", :
|
106
|
+
the_indented_markdown( <<-"END_MARKDOWN", :tables => true ).should be_transformed_into(<<-"END_HTML").without_indentation
|
92
107
|
First Header | Second Header
|
93
108
|
------------- | -------------
|
94
109
|
Content Cell | Content Cell
|
@@ -111,7 +126,7 @@ describe BlueCloth, "implementation of Discount-specific features" do
|
|
111
126
|
|
112
127
|
end
|
113
128
|
|
114
|
-
it "renders tables with leading and trailing pipes" do
|
129
|
+
it "renders tables with leading and trailing pipes", :pedantic => true do
|
115
130
|
pending "Discount doesn't support this kind (yet?)" do
|
116
131
|
the_indented_markdown( <<-"END_MARKDOWN", :tables => true ).should be_transformed_into(<<-"END_HTML").without_indentation
|
117
132
|
| First Header | Second Header |
|
@@ -141,7 +156,7 @@ describe BlueCloth, "implementation of Discount-specific features" do
|
|
141
156
|
end
|
142
157
|
end
|
143
158
|
|
144
|
-
it "renders tables with aligned columns" do
|
159
|
+
it "renders tables with aligned columns", :pedantic => true do
|
145
160
|
pending "Discount doesn't support this kind (yet?)" do
|
146
161
|
the_indented_markdown( <<-"END_MARKDOWN", :tables => true ).should be_transformed_into(<<-"END_HTML").without_indentation
|
147
162
|
| Item | Value |
|
@@ -177,6 +192,31 @@ describe BlueCloth, "implementation of Discount-specific features" do
|
|
177
192
|
end
|
178
193
|
end
|
179
194
|
|
195
|
+
|
196
|
+
describe "tilde strike-through" do
|
197
|
+
|
198
|
+
it "doesn't render tilde-bracketed test when :strikethrough isn't set" do
|
199
|
+
the_markdown( "~~cancelled~~" ).
|
200
|
+
should be_transformed_into( '<p>~~cancelled~~</p>' )
|
201
|
+
end
|
202
|
+
|
203
|
+
it "renders double tilde-bracketed text as strikethrough" do
|
204
|
+
the_markdown( "~~cancelled~~", :strikethrough => true ).
|
205
|
+
should be_transformed_into( '<p><del>cancelled</del></p>' )
|
206
|
+
end
|
207
|
+
|
208
|
+
it "renders tilde-bracketed text for tilde-brackets of more than two tildes" do
|
209
|
+
the_markdown( "~~~~cancelled~~~~", :strikethrough => true ).
|
210
|
+
should be_transformed_into( '<p><del>cancelled</del></p>' )
|
211
|
+
end
|
212
|
+
|
213
|
+
it "includes extra tildes in tilde-bracketed text" do
|
214
|
+
the_markdown( "~~~cancelled~~", :strikethrough => true ).
|
215
|
+
should be_transformed_into( '<p><del>~cancelled</del></p>' )
|
216
|
+
end
|
217
|
+
|
218
|
+
end
|
219
|
+
|
180
220
|
end
|
181
221
|
|
182
222
|
|