bluecloth 2.0.6.pre120-x86-mswin32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (112) hide show
  1. data/ChangeLog +363 -0
  2. data/LICENSE +27 -0
  3. data/LICENSE.discount +47 -0
  4. data/README +81 -0
  5. data/Rakefile +349 -0
  6. data/Rakefile.local +43 -0
  7. data/bin/bluecloth +84 -0
  8. data/ext/Csio.c +61 -0
  9. data/ext/VERSION +1 -0
  10. data/ext/amalloc.h +29 -0
  11. data/ext/bluecloth.c +391 -0
  12. data/ext/bluecloth.h +19 -0
  13. data/ext/config.h +55 -0
  14. data/ext/css.c +76 -0
  15. data/ext/cstring.h +75 -0
  16. data/ext/docheader.c +43 -0
  17. data/ext/extconf.rb +52 -0
  18. data/ext/generate.c +1602 -0
  19. data/ext/markdown.c +1078 -0
  20. data/ext/markdown.h +146 -0
  21. data/ext/mkdio.c +303 -0
  22. data/ext/mkdio.h +79 -0
  23. data/ext/resource.c +155 -0
  24. data/ext/version.c +28 -0
  25. data/ext/xml.c +82 -0
  26. data/ext/xmlpage.c +48 -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 +164 -0
  30. data/rake/191_compat.rb +26 -0
  31. data/rake/dependencies.rb +76 -0
  32. data/rake/helpers.rb +434 -0
  33. data/rake/hg.rb +273 -0
  34. data/rake/manual.rb +782 -0
  35. data/rake/packaging.rb +126 -0
  36. data/rake/publishing.rb +269 -0
  37. data/rake/rdoc.rb +30 -0
  38. data/rake/style.rb +62 -0
  39. data/rake/svn.rb +668 -0
  40. data/rake/testing.rb +187 -0
  41. data/rake/verifytask.rb +64 -0
  42. data/rake/win32.rb +190 -0
  43. data/spec/bluecloth/101_changes_spec.rb +141 -0
  44. data/spec/bluecloth/autolinks_spec.rb +49 -0
  45. data/spec/bluecloth/blockquotes_spec.rb +145 -0
  46. data/spec/bluecloth/code_spans_spec.rb +164 -0
  47. data/spec/bluecloth/emphasis_spec.rb +164 -0
  48. data/spec/bluecloth/entities_spec.rb +65 -0
  49. data/spec/bluecloth/hrules_spec.rb +90 -0
  50. data/spec/bluecloth/images_spec.rb +92 -0
  51. data/spec/bluecloth/inline_html_spec.rb +238 -0
  52. data/spec/bluecloth/links_spec.rb +171 -0
  53. data/spec/bluecloth/lists_spec.rb +294 -0
  54. data/spec/bluecloth/paragraphs_spec.rb +75 -0
  55. data/spec/bluecloth/titles_spec.rb +305 -0
  56. data/spec/bluecloth_spec.rb +281 -0
  57. data/spec/bugfix_spec.rb +172 -0
  58. data/spec/contributions_spec.rb +85 -0
  59. data/spec/data/antsugar.txt +34 -0
  60. data/spec/data/markdowntest/Amps and angle encoding.html +17 -0
  61. data/spec/data/markdowntest/Amps and angle encoding.text +21 -0
  62. data/spec/data/markdowntest/Auto links.html +18 -0
  63. data/spec/data/markdowntest/Auto links.text +13 -0
  64. data/spec/data/markdowntest/Backslash escapes.html +118 -0
  65. data/spec/data/markdowntest/Backslash escapes.text +120 -0
  66. data/spec/data/markdowntest/Blockquotes with code blocks.html +15 -0
  67. data/spec/data/markdowntest/Blockquotes with code blocks.text +11 -0
  68. data/spec/data/markdowntest/Code Blocks.html +18 -0
  69. data/spec/data/markdowntest/Code Blocks.text +14 -0
  70. data/spec/data/markdowntest/Code Spans.html +5 -0
  71. data/spec/data/markdowntest/Code Spans.text +5 -0
  72. data/spec/data/markdowntest/Hard-wrapped paragraphs with list-like lines.html +8 -0
  73. data/spec/data/markdowntest/Hard-wrapped paragraphs with list-like lines.text +8 -0
  74. data/spec/data/markdowntest/Horizontal rules.html +71 -0
  75. data/spec/data/markdowntest/Horizontal rules.text +67 -0
  76. data/spec/data/markdowntest/Inline HTML (Advanced).html +15 -0
  77. data/spec/data/markdowntest/Inline HTML (Advanced).text +15 -0
  78. data/spec/data/markdowntest/Inline HTML (Simple).html +72 -0
  79. data/spec/data/markdowntest/Inline HTML (Simple).text +69 -0
  80. data/spec/data/markdowntest/Inline HTML comments.html +13 -0
  81. data/spec/data/markdowntest/Inline HTML comments.text +13 -0
  82. data/spec/data/markdowntest/Links, inline style.html +11 -0
  83. data/spec/data/markdowntest/Links, inline style.text +12 -0
  84. data/spec/data/markdowntest/Links, reference style.html +52 -0
  85. data/spec/data/markdowntest/Links, reference style.text +71 -0
  86. data/spec/data/markdowntest/Links, shortcut references.html +9 -0
  87. data/spec/data/markdowntest/Links, shortcut references.text +20 -0
  88. data/spec/data/markdowntest/Literal quotes in titles.html +3 -0
  89. data/spec/data/markdowntest/Literal quotes in titles.text +7 -0
  90. data/spec/data/markdowntest/Markdown Documentation - Basics.html +314 -0
  91. data/spec/data/markdowntest/Markdown Documentation - Basics.text +306 -0
  92. data/spec/data/markdowntest/Markdown Documentation - Syntax.html +942 -0
  93. data/spec/data/markdowntest/Markdown Documentation - Syntax.text +888 -0
  94. data/spec/data/markdowntest/Nested blockquotes.html +9 -0
  95. data/spec/data/markdowntest/Nested blockquotes.text +5 -0
  96. data/spec/data/markdowntest/Ordered and unordered lists.html +148 -0
  97. data/spec/data/markdowntest/Ordered and unordered lists.text +131 -0
  98. data/spec/data/markdowntest/Strong and em together.html +7 -0
  99. data/spec/data/markdowntest/Strong and em together.text +7 -0
  100. data/spec/data/markdowntest/Tabs.html +25 -0
  101. data/spec/data/markdowntest/Tabs.text +21 -0
  102. data/spec/data/markdowntest/Tidyness.html +8 -0
  103. data/spec/data/markdowntest/Tidyness.text +5 -0
  104. data/spec/data/ml-announce.txt +17 -0
  105. data/spec/data/re-overflow.txt +67 -0
  106. data/spec/data/re-overflow2.txt +281 -0
  107. data/spec/discount_spec.rb +184 -0
  108. data/spec/lib/constants.rb +5 -0
  109. data/spec/lib/helpers.rb +137 -0
  110. data/spec/lib/matchers.rb +235 -0
  111. data/spec/markdowntest_spec.rb +79 -0
  112. metadata +205 -0
@@ -0,0 +1,281 @@
1
+ <strong>iFotobilder</strong> will be an iPhoto export plugin that will let you manage your Fotobilder pictures through iPhoto.
2
+
3
+ ## Getting Started
4
+
5
+ Since iPhoto's APIs aren't public, and because my Objective C is extremely rusty, I wanted a couple of examples of other people's plugins before I dove into this.
6
+
7
+ Here's what I found:
8
+
9
+ * [Writing Plugins for Cocoa][1]
10
+
11
+ [1]: http://www.stone.com/The_Cocoa_Files/Writing_PlugIns.html
12
+
13
+ ## The iPhoto Export API
14
+
15
+ Using the `class-dump` tool, I dumped the export API:
16
+
17
+ /*
18
+ * Generated by class-dump 3.0.
19
+ *
20
+ * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004 by Steve Nygard.
21
+ */
22
+
23
+ /*
24
+ * File: /Applications/iPhoto.app/Contents/MacOS/iPhoto
25
+ */
26
+
27
+ @protocol ExportImageProtocol
28
+ - (unsigned int)imageCount;
29
+ - (BOOL)imageIsPortraitAtIndex:(unsigned int)fp20;
30
+ - (struct _NSSize)imageSizeAtIndex:(unsigned int)fp16;
31
+ - (unsigned int)imageFormatAtIndex:(unsigned int)fp16;
32
+ - (id)imageCaptionAtIndex:(unsigned int)fp16;
33
+ - (id)imagePathAtIndex:(unsigned int)fp16;
34
+ - (id)thumbnailPathAtIndex:(unsigned int)fp16;
35
+ - (id)imageDictionaryAtIndex:(unsigned int)fp16;
36
+ - (float)imageAspectRatioAtIndex:(unsigned int)fp16;
37
+ - (id)albumName;
38
+ - (id)albumMusicPath;
39
+ - (unsigned int)albumCount;
40
+ - (unsigned int)albumPositionOfImageAtIndex:(unsigned int)fp16;
41
+ - (id)window;
42
+ - (void)enableControls;
43
+ - (void)disableControls;
44
+ - (void)clickExport;
45
+ - (void)startExport;
46
+ - (void)cancelExport;
47
+ - (void)cancelExportBeforeBeginning;
48
+ - (id)directoryPath;
49
+ - (id)temporaryDirectory;
50
+ - (BOOL)doesFileExist:(id)fp16;
51
+ - (BOOL)doesDirectoryExist:(id)fp16;
52
+ - (BOOL)createDir:(id)fp16;
53
+ - (id)uniqueSubPath:(id)fp12 child:(id)fp20;
54
+ - (id)makeUniquePath:(id)fp16;
55
+ - (id)makeUniqueFilePath:(id)fp12 extension:(id)fp20;
56
+ - (id)makeUniqueFileNameWithTime:(id)fp16;
57
+ - (BOOL)makeFSSpec:(id)fp12 spec:(struct FSSpec *)fp20;
58
+ - (id)pathForFSSpec:(id)fp16;
59
+ - (BOOL)getFSRef:(struct FSRef *)fp12 forPath:(id)fp16 isDirectory:(BOOL)fp27;
60
+ - (id)pathForFSRef:(struct FSRef *)fp16;
61
+ - (unsigned long)countFiles:(id)fp12 descend:(BOOL)fp23;
62
+ - (unsigned long)countFilesFromArray:(id)fp12 descend:(BOOL)fp23;
63
+ - (unsigned long long)sizeAtPath:(id)fp12 count:(unsigned long *)fp16 physical:(BOOL)fp27;
64
+ - (BOOL)isAliasFileAtPath:(id)fp16;
65
+ - (id)pathContentOfAliasAtPath:(id)fp16;
66
+ - (id)stringByResolvingAliasesInPath:(id)fp16;
67
+ - (BOOL)ensurePermissions:(unsigned long)fp12 forPath:(id)fp20;
68
+ - (id)validFilename:(id)fp16;
69
+ - (id)getExtensionForImageFormat:(unsigned int)fp16;
70
+ - (unsigned int)getImageFormatForExtension:(id)fp16;
71
+ - (struct OpaqueGrafPtr *)uncompressImage:(id)fp12 size:(struct _NSSize)fp16 pixelFormat:(unsigned int)fp24 rotation:(float)fp32;
72
+ - (void *)createThumbnailer;
73
+ - (void *)retainThumbnailer:(void *)fp16;
74
+ - (void *)autoreleaseThumbnailer:(void *)fp16;
75
+ - (void)releaseThumbnailer:(void *)fp16;
76
+ - (void)setThumbnailer:(void *)fp16 maxBytes:(unsigned int)fp20 maxWidth:(unsigned int)fp24 maxHeight:(unsigned int)fp32;
77
+ - (struct _NSSize)thumbnailerMaxBounds:(void *)fp16;
78
+ - (void)setThumbnailer:(void *)fp12 quality:(int)fp20;
79
+ - (int)thumbnailerQuality:(void *)fp16;
80
+ - (void)setThumbnailer:(void *)fp12 rotation:(float)fp20;
81
+ - (float)thumbnailerRotation:(void *)fp16;
82
+ - (void)setThumbnailer:(void *)fp12 outputFormat:(unsigned int)fp20;
83
+ - (unsigned int)thumbnailerOutputFormat:(void *)fp16;
84
+ - (void)setThumbnailer:(void *)fp12 outputExtension:(id)fp20;
85
+ - (id)thumbnailerOutputExtension:(void *)fp16;
86
+ - (BOOL)thumbnailer:(void *)fp16 createThumbnail:(id)fp20 dest:(id)fp28;
87
+ - (struct _NSSize)lastImageSize:(void *)fp20;
88
+ - (struct _NSSize)lastThumbnailSize:(void *)fp16;
89
+ @end
90
+
91
+ @protocol ExportPluginBoxProtocol
92
+ - (BOOL)performKeyEquivalent:(id)fp16;
93
+ @end
94
+
95
+ @protocol ExportPluginProtocol
96
+ - (id)initWithExportImageObj:(id)fp16;
97
+ - (id)settingsView;
98
+ - (id)firstView;
99
+ - (id)lastView;
100
+ - (void)viewWillBeActivated;
101
+ - (void)viewWillBeDeactivated;
102
+ - (id)requiredFileType;
103
+ - (BOOL)wantsDestinationPrompt;
104
+ - (id)getDestinationPath;
105
+ - (id)defaultFileName;
106
+ - (id)defaultDirectory;
107
+ - (BOOL)treatSingleSelectionDifferently;
108
+ - (BOOL)validateUserCreatedPath:(id)fp16;
109
+ - (void)clickExport;
110
+ - (void)startExport:(id)fp16;
111
+ - (void)performExport:(id)fp16;
112
+ - (CDAnonymousStruct12 *)progress;
113
+ - (void)lockProgress;
114
+ - (void)unlockProgress;
115
+ - (void)cancelExport;
116
+ - (id)name;
117
+ - (id)description;
118
+ @end
119
+
120
+ @interface ExportController : NSObject
121
+ {
122
+ id mWindow;
123
+ id mExportView;
124
+ id mExportButton;
125
+ id mImageCount;
126
+ ExportMgr *mExportMgr;
127
+ ExportMgrRec *mCurrentPluginRec;
128
+ ProgressController *mProgressController;
129
+ BOOL mCancelExport;
130
+ NSTimer *mTimer;
131
+ NSString *mDirectoryPath;
132
+ }
133
+
134
+ - (void)awakeFromNib;
135
+ - (void)dealloc;
136
+ - (id)currentPlugin;
137
+ - (id)currentPluginRec;
138
+ - (void)setCurrentPluginRec:(id)fp12;
139
+ - (id)directoryPath;
140
+ - (void)setDirectoryPath:(id)fp12;
141
+ - (void)show;
142
+ - (void)_openPanelDidEnd:(id)fp12 returnCode:(int)fp16 contextInfo:(void *)fp20;
143
+ - (id)panel:(id)fp12 userEnteredFilename:(id)fp16 confirmed:(BOOL)fp20;
144
+ - (BOOL)panel:(id)fp12 shouldShowFilename:(id)fp16;
145
+ - (BOOL)panel:(id)fp12 isValidFilename:(id)fp16;
146
+ - (BOOL)filesWillFitOnDisk;
147
+ - (void)export:(id)fp12;
148
+ - (void)_exportThread:(id)fp12;
149
+ - (void)_exportProgress:(id)fp12;
150
+ - (void)startExport:(id)fp12;
151
+ - (void)finishExport;
152
+ - (void)cancelExport;
153
+ - (void)cancel:(id)fp12;
154
+ - (void)enableControls;
155
+ - (id)window;
156
+ - (void)disableControls;
157
+ - (void)tabView:(id)fp12 willSelectTabViewItem:(id)fp16;
158
+ - (void)tabView:(id)fp12 didSelectTabViewItem:(id)fp16;
159
+ - (void)selectExporter:(id)fp12;
160
+ - (id)exportView;
161
+ - (BOOL)_hasPlugins;
162
+ - (void)_resizeExporterToFitView:(id)fp12;
163
+ - (void)_updateImageCount;
164
+
165
+ @end
166
+
167
+ @interface ExportMgr : NSObject <ExportImageProtocol>
168
+ {
169
+ ArchiveDocument *mDocument;
170
+ NSMutableArray *mExporters;
171
+ Album *mExportAlbum;
172
+ NSArray *mSelection;
173
+ ExportController *mExportController;
174
+ }
175
+
176
+ + (id)exportMgr;
177
+ + (id)exportMgrNoAlloc;
178
+ - (id)init;
179
+ - (void)dealloc;
180
+ - (void)releasePlugins;
181
+ - (void)setExportController:(id)fp12;
182
+ - (id)exportController;
183
+ - (void)setDocument:(id)fp12;
184
+ - (id)document;
185
+ - (void)updateDocumentSelection;
186
+ - (unsigned int)count;
187
+ - (id)recAtIndex:(unsigned int)fp12;
188
+ - (void)scanForExporters;
189
+ - (unsigned int)imageCount;
190
+ - (BOOL)imageIsPortraitAtIndex:(unsigned int)fp12;
191
+ - (id)imagePathAtIndex:(unsigned int)fp12;
192
+ - (struct _NSSize)imageSizeAtIndex:(unsigned int)fp16;
193
+ - (unsigned int)imageFormatAtIndex:(unsigned int)fp12;
194
+ - (id)imageCaptionAtIndex:(unsigned int)fp12;
195
+ - (id)thumbnailPathAtIndex:(unsigned int)fp12;
196
+ - (id)imageDictionaryAtIndex:(unsigned int)fp12;
197
+ - (float)imageAspectRatioAtIndex:(unsigned int)fp12;
198
+ - (id)albumName;
199
+ - (id)albumMusicPath;
200
+ - (unsigned int)albumCount;
201
+ - (unsigned int)albumPositionOfImageAtIndex:(unsigned int)fp12;
202
+ - (id)imageRecAtIndex:(unsigned int)fp12;
203
+ - (id)currentAlbum;
204
+ - (void)enableControls;
205
+ - (void)disableControls;
206
+ - (id)window;
207
+ - (void)clickExport;
208
+ - (void)startExport;
209
+ - (void)cancelExport;
210
+ - (void)cancelExportBeforeBeginning;
211
+ - (id)directoryPath;
212
+ - (void)_copySelection:(id)fp12;
213
+ - (id)temporaryDirectory;
214
+ - (BOOL)doesFileExist:(id)fp12;
215
+ - (BOOL)doesDirectoryExist:(id)fp12;
216
+ - (BOOL)createDir:(id)fp12;
217
+ - (id)uniqueSubPath:(id)fp12 child:(id)fp16;
218
+ - (id)makeUniquePath:(id)fp12;
219
+ - (id)makeUniqueFilePath:(id)fp12 extension:(id)fp16;
220
+ - (id)makeUniqueFileNameWithTime:(id)fp12;
221
+ - (BOOL)makeFSSpec:(id)fp12 spec:(struct FSSpec *)fp16;
222
+ - (id)pathForFSSpec:(id)fp12;
223
+ - (BOOL)getFSRef:(struct FSRef *)fp12 forPath:(id)fp16 isDirectory:(BOOL)fp20;
224
+ - (id)pathForFSRef:(struct FSRef *)fp12;
225
+ - (unsigned long)countFiles:(id)fp12 descend:(BOOL)fp16;
226
+ - (unsigned long)countFilesFromArray:(id)fp12 descend:(BOOL)fp16;
227
+ - (unsigned long long)sizeAtPath:(id)fp12 count:(unsigned long *)fp16 physical:(BOOL)fp20;
228
+ - (BOOL)isAliasFileAtPath:(id)fp12;
229
+ - (id)pathContentOfAliasAtPath:(id)fp12;
230
+ - (id)stringByResolvingAliasesInPath:(id)fp12;
231
+ - (BOOL)ensurePermissions:(unsigned long)fp12 forPath:(id)fp16;
232
+ - (id)validFilename:(id)fp12;
233
+ - (id)getExtensionForImageFormat:(unsigned int)fp12;
234
+ - (unsigned int)getImageFormatForExtension:(id)fp12;
235
+ - (struct OpaqueGrafPtr *)uncompressImage:(id)fp12 size:(struct _NSSize)fp16 pixelFormat:(unsigned int)fp24 rotation:(float)fp36;
236
+ - (void *)createThumbnailer;
237
+ - (void *)retainThumbnailer:(void *)fp12;
238
+ - (void *)autoreleaseThumbnailer:(void *)fp12;
239
+ - (void)releaseThumbnailer:(void *)fp12;
240
+ - (void)setThumbnailer:(void *)fp12 maxBytes:(unsigned int)fp16 maxWidth:(unsigned int)fp20 maxHeight:(unsigned int)fp24;
241
+ - (struct _NSSize)thumbnailerMaxBounds:(void *)fp16;
242
+ - (void)setThumbnailer:(void *)fp12 quality:(int)fp16;
243
+ - (int)thumbnailerQuality:(void *)fp12;
244
+ - (void)setThumbnailer:(void *)fp12 rotation:(float)fp36;
245
+ - (float)thumbnailerRotation:(void *)fp12;
246
+ - (void)setThumbnailer:(void *)fp12 outputFormat:(unsigned int)fp16;
247
+ - (unsigned int)thumbnailerOutputFormat:(void *)fp12;
248
+ - (void)setThumbnailer:(void *)fp12 outputExtension:(id)fp16;
249
+ - (id)thumbnailerOutputExtension:(void *)fp12;
250
+ - (BOOL)thumbnailer:(void *)fp12 createThumbnail:(id)fp16 dest:(id)fp20;
251
+ - (struct _NSSize)lastImageSize:(void *)fp16;
252
+ - (struct _NSSize)lastThumbnailSize:(void *)fp16;
253
+
254
+ @end
255
+
256
+ @interface ExportMgrRec : NSObject
257
+ {
258
+ NSString *mPath;
259
+ NSBundle *mBundle;
260
+ id mPlugin;
261
+ struct _NSSize mViewSize;
262
+ }
263
+
264
+ - (void)dealloc;
265
+ - (BOOL)isEqual:(id)fp12;
266
+ - (id)description;
267
+ - (id)initWithPath:(id)fp12;
268
+ - (id)path;
269
+ - (id)bundle;
270
+ - (id)bundleInfo;
271
+ - (BOOL)isValidExportPlugin;
272
+ - (BOOL)loadPlugin;
273
+ - (id)exportPlugin;
274
+ - (void)unloadPlugin;
275
+ - (id)view;
276
+ - (struct _NSSize)viewSize;
277
+ - (void)setPath:(id)fp12;
278
+ - (void)setBundle:(id)fp12;
279
+
280
+ @end
281
+
@@ -0,0 +1,184 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ BEGIN {
4
+ require 'pathname'
5
+ basedir = Pathname.new( __FILE__ ).dirname.parent
6
+
7
+ libdir = basedir + 'lib'
8
+ extdir = basedir + 'ext'
9
+
10
+ $LOAD_PATH.unshift( libdir ) unless $LOAD_PATH.include?( libdir )
11
+ $LOAD_PATH.unshift( extdir ) unless $LOAD_PATH.include?( extdir )
12
+ }
13
+
14
+ require 'rubygems'
15
+ require 'spec'
16
+ require 'bluecloth'
17
+
18
+ require 'spec/lib/helpers'
19
+ require 'spec/lib/constants'
20
+ require 'spec/lib/matchers'
21
+
22
+
23
+ #####################################################################
24
+ ### C O N T E X T S
25
+ #####################################################################
26
+
27
+ describe BlueCloth, "implementation of Discount-specific features" do
28
+ include BlueCloth::TestConstants,
29
+ BlueCloth::Matchers
30
+
31
+ before( :all ) do
32
+ @basedir = Pathname.new( __FILE__ ).dirname.parent
33
+ @datadir = @basedir + 'spec/data'
34
+ end
35
+
36
+
37
+ describe "pseudo-protocols" do
38
+
39
+ it "renders abbr: links as <abbr> phrases" do
40
+ the_indented_markdown( <<-"---", :pseudoprotocols => true ).should be_transformed_into(<<-"---").without_indentation
41
+ The [ASPCA](abbr:American Society for the Prevention of Cruelty to Animals).
42
+ ---
43
+ <p>The <abbr title="American Society for the Prevention of Cruelty to Animals">ASPCA</abbr>.</p>
44
+ ---
45
+ end
46
+
47
+ it "renders id: links as anchors with an ID" do
48
+ the_markdown( "[foo](id:bar)", :pseudoprotocols => true ).
49
+ should be_transformed_into( '<p><a id="bar">foo</a></p>' )
50
+ end
51
+
52
+ it "renders class: links as SPANs with a CLASS" do
53
+ the_markdown( "[foo](class:bar)", :pseudoprotocols => true ).
54
+ should be_transformed_into( '<p><span class="bar">foo</span></p>' )
55
+ end
56
+
57
+ it "renders raw: links as-is with no syntax expansion" do
58
+ the_markdown( "[foo](raw:bar)", :pseudoprotocols => true ).
59
+ should be_transformed_into( '<p>bar</p>' )
60
+ end
61
+
62
+ end
63
+
64
+
65
+ describe "Markdown-Extra tables" do
66
+
67
+ it "renders the example from orc's blog" do
68
+ the_indented_markdown( <<-"END_MARKDOWN", :strict => false ).should be_transformed_into(<<-"END_HTML").without_indentation
69
+ a | b
70
+ -----|-----
71
+ hello|sailor
72
+ END_MARKDOWN
73
+ <table>
74
+ <thead>
75
+ <tr>
76
+ <th> a </th>
77
+ <th> b</th>
78
+ </tr>
79
+ </thead>
80
+ <tbody>
81
+ <tr>
82
+ <td>hello</td>
83
+ <td>sailor</td>
84
+ </tr>
85
+ </tbody>
86
+ </table>
87
+ END_HTML
88
+ end
89
+
90
+ it "renders simple markdown-extra tables" do
91
+ the_indented_markdown( <<-"END_MARKDOWN", :strict => false ).should be_transformed_into(<<-"END_HTML").without_indentation
92
+ First Header | Second Header
93
+ ------------- | -------------
94
+ Content Cell | Content Cell
95
+ END_MARKDOWN
96
+ <table>
97
+ <thead>
98
+ <tr>
99
+ <th>First Header </th>
100
+ <th> Second Header</th>
101
+ </tr>
102
+ </thead>
103
+ <tbody>
104
+ <tr>
105
+ <td>Content Cell </td>
106
+ <td> Content Cell</td>
107
+ </tr>
108
+ </tbody>
109
+ </table>
110
+ END_HTML
111
+
112
+ end
113
+
114
+ it "renders tables with leading and trailing pipes" do
115
+ pending "Discount doesn't support this kind (yet?)" do
116
+ the_indented_markdown( <<-"END_MARKDOWN", :tables => true ).should be_transformed_into(<<-"END_HTML").without_indentation
117
+ | First Header | Second Header |
118
+ | ------------- | ------------- |
119
+ | Content Cell | Content Cell |
120
+ | Content Cell | Content Cell |
121
+ END_MARKDOWN
122
+ <table>
123
+ <thead>
124
+ <tr>
125
+ <th>First Header </th>
126
+ <th> Second Header</th>
127
+ </tr>
128
+ </thead>
129
+ <tbody>
130
+ <tr>
131
+ <td>Content Cell </td>
132
+ <td> Content Cell</td>
133
+ </tr>
134
+ <tr>
135
+ <td>Content Cell </td>
136
+ <td> Content Cell</td>
137
+ </tr>
138
+ </tbody>
139
+ </table>
140
+ END_HTML
141
+ end
142
+ end
143
+
144
+ it "renders tables with aligned columns" do
145
+ pending "Discount doesn't support this kind (yet?)" do
146
+ the_indented_markdown( <<-"END_MARKDOWN", :tables => true ).should be_transformed_into(<<-"END_HTML").without_indentation
147
+ | Item | Value |
148
+ | --------- | -----:|
149
+ | Computer | $1600 |
150
+ | Phone | $12 |
151
+ | Pipe | $1 |
152
+ END_MARKDOWN
153
+ <table>
154
+ <thead>
155
+ <tr>
156
+ <th>Item </th>
157
+ <th align="right"> Value</th>
158
+ </tr>
159
+ </thead>
160
+ <tbody>
161
+ <tr>
162
+ <td>Computer </td>
163
+ <td align="right"> $1600</td>
164
+ </tr>
165
+ <tr>
166
+ <td>Phone </td>
167
+ <td align="right"> $12</td>
168
+ </tr>
169
+ <tr>
170
+ <td>Pipe </td>
171
+ <td align="right"> $1</td>
172
+ </tr>
173
+ </tbody>
174
+ </table>
175
+ END_HTML
176
+ end
177
+ end
178
+ end
179
+
180
+ end
181
+
182
+
183
+ __END__
184
+