bluecloth 2.0.7 → 2.0.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. data.tar.gz.sig +0 -0
  2. data/ChangeLog +36 -6
  3. data/Rakefile +46 -26
  4. data/Rakefile.local +13 -6
  5. data/ext/VERSION +1 -1
  6. data/ext/bluecloth.c +46 -21
  7. data/ext/bluecloth.h +13 -2
  8. data/ext/cstring.h +3 -1
  9. data/ext/emmatch.c +188 -0
  10. data/ext/generate.c +203 -248
  11. data/ext/html5.c +24 -0
  12. data/ext/markdown.c +122 -98
  13. data/ext/markdown.h +16 -2
  14. data/ext/mkdio.c +43 -9
  15. data/ext/mkdio.h +11 -0
  16. data/ext/resource.c +1 -1
  17. data/ext/tags.c +110 -0
  18. data/ext/tags.h +18 -0
  19. data/lib/bluecloth.rb +33 -26
  20. data/rake/documentation.rb +115 -0
  21. data/rake/helpers.rb +375 -308
  22. data/rake/hg.rb +17 -3
  23. data/rake/manual.rb +11 -6
  24. data/rake/packaging.rb +7 -1
  25. data/rake/publishing.rb +162 -88
  26. data/spec/bluecloth/101_changes_spec.rb +1 -0
  27. data/spec/bluecloth/autolinks_spec.rb +1 -0
  28. data/spec/bluecloth/blockquotes_spec.rb +1 -0
  29. data/spec/bluecloth/code_spans_spec.rb +1 -0
  30. data/spec/bluecloth/emphasis_spec.rb +1 -0
  31. data/spec/bluecloth/entities_spec.rb +1 -0
  32. data/spec/bluecloth/hrules_spec.rb +1 -0
  33. data/spec/bluecloth/images_spec.rb +1 -0
  34. data/spec/bluecloth/inline_html_spec.rb +25 -61
  35. data/spec/bluecloth/lists_spec.rb +1 -0
  36. data/spec/bluecloth/paragraphs_spec.rb +1 -0
  37. data/spec/bluecloth/titles_spec.rb +1 -0
  38. data/spec/bluecloth_spec.rb +22 -6
  39. data/spec/bugfix_spec.rb +79 -2
  40. data/spec/contributions_spec.rb +1 -0
  41. data/spec/discount_spec.rb +46 -2
  42. data/spec/lib/helpers.rb +8 -8
  43. data/spec/lib/matchers.rb +5 -17
  44. data/spec/markdowntest_spec.rb +2 -34
  45. metadata +48 -17
  46. metadata.gz.sig +0 -0
  47. data/rake/rdoc.rb +0 -30
data.tar.gz.sig ADDED
Binary file
data/ChangeLog CHANGED
@@ -1,4 +1,34 @@
1
- 128[tip] ba2087a764a2 2010-01-25 13:35 -0800 ged
1
+ 138[tip] 486a5a2a8cd2 2010-09-23 07:15 -0700 ged
2
+ Bump version, update the Windows build to use 1.9.2 instead of 1.9.1.
3
+
4
+ 137 1caa0c888dfe 2010-09-17 15:03 -0700 ged
5
+ Updated to Discount 1.6.8, caught up with some Discount flags
6
+
7
+ 136 d21afe457b3a 2010-09-17 14:12 -0700 ged
8
+ Trying to add a spec to test #68.
9
+
10
+ 135 eb11956b000d 2010-09-17 13:48 -0700 ged
11
+ Tried to add a spec to test #67.
12
+
13
+ 134 055519ec5f78 2010-09-17 13:42 -0700 ged
14
+ Cleanup, 1.9.2 compatibility, bugfixes.
15
+
16
+ 133 3122e81da65b 2010-09-17 13:25 -0700 ged
17
+ Convert to tidy-ext for testing instead of the ffi one (1.9.x compatibility)
18
+
19
+ 132 3f36f96bfb8e 2010-08-16 11:50 -0700 ged
20
+ Install extension in arch-specific subdir [RPS]
21
+
22
+ 131 8ccd2cfe599e 2010-08-11 09:54 -0600 ged
23
+ Bump version to 2.0.8
24
+
25
+ 130 f2d6de73c6d6 2010-08-11 09:54 -0600 ged
26
+ Updated to Discount 1.6.6; add HTML5 tag support.
27
+
28
+ 129 7b1630a0f3b2 2010-08-11 09:27 -0600 ged
29
+ Updated for Discount 1.6.4, build system updates.
30
+
31
+ 128 ba2087a764a2 2010-01-25 13:35 -0800 ged
2
32
  Added tag 2.0.7 for changeset 2e54366aeac1
3
33
 
4
34
  127[2.0.7] 2e54366aeac1 2010-01-25 13:35 -0800 ged
@@ -40,15 +70,15 @@
40
70
  115 b715702c19f7 2010-01-02 15:08 -0800 ged
41
71
  Adding a minimal test case for #60.
42
72
 
43
- 114:113,112 617e767c1331 2010-01-02 14:49 -0800 ged
73
+ 114:112,113 617e767c1331 2010-01-02 14:49 -0800 ged
44
74
  Added spec for #56 so I can close it.
45
75
 
46
- 113:111 5c81c9a5012f 2010-01-01 10:54 -0800 ged
47
- Build with rake-compiler, fix some bugs.
48
-
49
- 112 8be386ec10a8 2009-11-04 15:56 -0800 ged
76
+ 113:111 8be386ec10a8 2009-11-04 15:56 -0800 ged
50
77
  Updated build files.
51
78
 
79
+ 112 5c81c9a5012f 2010-01-01 10:54 -0800 ged
80
+ Build with rake-compiler, fix some bugs.
81
+
52
82
  111 ce4fb0ebf7c0 2009-08-03 12:58 -0700 ged
53
83
  * Updated to Discount 1.5 (+bugfixes)
54
84
 
data/Rakefile CHANGED
@@ -11,12 +11,14 @@
11
11
  #
12
12
 
13
13
  BEGIN {
14
+ require 'rbconfig'
14
15
  require 'pathname'
15
16
  basedir = Pathname.new( __FILE__ ).dirname
16
17
 
17
18
  libdir = basedir + "lib"
18
- extdir = basedir + "ext"
19
+ extdir = libdir + Config::CONFIG['sitearch']
19
20
 
21
+ $LOAD_PATH.unshift( basedir.to_s ) unless $LOAD_PATH.include?( basedir.to_s )
20
22
  $LOAD_PATH.unshift( libdir.to_s ) unless $LOAD_PATH.include?( libdir.to_s )
21
23
  $LOAD_PATH.unshift( extdir.to_s ) unless $LOAD_PATH.include?( extdir.to_s )
22
24
  }
@@ -73,10 +75,10 @@ if VERSION_FILE.exist? && buildrev = ENV['CC_BUILD_LABEL']
73
75
  PKG_VERSION = VERSION_FILE.read[ /VERSION\s*=\s*['"](\d+\.\d+\.\d+)['"]/, 1 ] + '.' + buildrev
74
76
  elsif VERSION_FILE.exist?
75
77
  PKG_VERSION = VERSION_FILE.read[ /VERSION\s*=\s*['"](\d+\.\d+\.\d+)['"]/, 1 ]
76
- else
77
- PKG_VERSION = '0.0.0'
78
78
  end
79
79
 
80
+ PKG_VERSION = '0.0.0' unless defined?( PKG_VERSION ) && !PKG_VERSION.nil?
81
+
80
82
  PKG_FILE_NAME = "#{PKG_NAME.downcase}-#{PKG_VERSION}"
81
83
  GEM_FILE_NAME = "#{PKG_FILE_NAME}.gem"
82
84
 
@@ -90,7 +92,7 @@ EXTCONF = EXTDIR + 'extconf.rb'
90
92
 
91
93
  ARTIFACTS_DIR = Pathname.new( CC_BUILD_ARTIFACTS )
92
94
 
93
- TEXT_FILES = Rake::FileList.new( %w[Rakefile ChangeLog README LICENSE] )
95
+ TEXT_FILES = Rake::FileList.new( %w[Rakefile ChangeLog README* LICENSE] )
94
96
  BIN_FILES = Rake::FileList.new( "#{BINDIR}/*" )
95
97
  LIB_FILES = Rake::FileList.new( "#{LIBDIR}/**/*.rb" )
96
98
  EXT_FILES = Rake::FileList.new( "#{EXTDIR}/**/*.{c,h,rb}" )
@@ -166,26 +168,37 @@ if !RAKE_TASKDIR.exist?
166
168
  end
167
169
 
168
170
  require RAKE_TASKDIR + 'helpers.rb'
171
+ include RakefileHelpers
169
172
 
170
173
  # Set the build ID if the mercurial executable is available
171
174
  if hg = which( 'hg' )
172
- id = IO.read('|-') or exec hg.to_s, 'id', '-n'
173
- PKG_BUILD = 'pre' + (id.chomp[ /^[[:xdigit:]]+/ ] || '1')
175
+ id = `#{hg} id -n`.chomp
176
+ PKG_BUILD = "pre%03d" % [(id.chomp[ /^[[:xdigit:]]+/ ] || '1')]
174
177
  else
175
- PKG_BUILD = 'pre0'
178
+ PKG_BUILD = 'pre000'
176
179
  end
177
180
  SNAPSHOT_PKG_NAME = "#{PKG_FILE_NAME}.#{PKG_BUILD}"
178
181
  SNAPSHOT_GEM_NAME = "#{SNAPSHOT_PKG_NAME}.gem"
179
182
 
180
183
  # Documentation constants
181
- RDOCDIR = DOCSDIR + 'api'
184
+ API_DOCSDIR = DOCSDIR + 'api'
185
+ README_FILE = TEXT_FILES.find {|path| path =~ /^README/ } || 'README'
182
186
  RDOC_OPTIONS = [
183
- '-w', '4',
184
- '-HN',
185
- '-i', '.',
186
- '-m', 'README',
187
- '-t', PKG_NAME,
188
- '-W', 'http://deveiate.org/projects/BlueCloth/browser/'
187
+ '--tab-width=4',
188
+ '--show-hash',
189
+ '--include', BASEDIR.to_s,
190
+ "--main=#{README_FILE}",
191
+ "--title=#{PKG_NAME}",
192
+ ]
193
+ YARD_OPTIONS = [
194
+ '--use-cache',
195
+ '--no-private',
196
+ '--protected',
197
+ '-r', README_FILE,
198
+ '--exclude', 'extconf\\.rb',
199
+ '--files', 'ChangeLog,LICENSE',
200
+ '--output-dir', API_DOCSDIR.to_s,
201
+ '--title', "#{PKG_NAME} #{PKG_VERSION}",
189
202
  ]
190
203
 
191
204
  # Release constants
@@ -199,22 +212,25 @@ PROJECT_DOCDIR = "#{PROJECT_PUBDIR}/#{PKG_NAME}"
199
212
  PROJECT_SCPPUBURL = "#{PROJECT_HOST}:#{PROJECT_PUBDIR}"
200
213
  PROJECT_SCPDOCURL = "#{PROJECT_HOST}:#{PROJECT_DOCDIR}"
201
214
 
215
+ GEM_PUBHOST = 'rubygems.org'
216
+
202
217
  # Gem dependencies: gemname => version
203
218
  DEPENDENCIES = {
204
219
  }
205
220
 
206
221
  # Developer Gem dependencies: gemname => version
207
222
  DEVELOPMENT_DEPENDENCIES = {
208
- 'rake' => '>= 0.8.7',
209
- 'rcodetools' => '>= 0.7.0.0',
210
- 'rcov' => '>= 0.8.1.2.0',
211
- 'rdoc' => '>= 2.4.3',
212
- 'RedCloth' => '>= 4.0.3',
213
- 'rspec' => '>= 1.2.6',
214
- 'termios' => '>= 0',
215
- 'text-format' => '>= 1.0.0',
216
- 'tmail' => '>= 1.2.3.1',
217
- 'diff-lcs' => '>= 1.1.2',
223
+ 'rake' => '>= 0.8.7',
224
+ 'rcodetools' => '>= 0.7.0.0',
225
+ 'rcov' => '>= 0.8.1.2.0',
226
+ 'rdoc' => '>= 2.4.3',
227
+ 'RedCloth' => '>= 4.0.3',
228
+ 'rspec' => '>= 1.2.6',
229
+ 'ruby-termios' => '>= 0.9.6',
230
+ 'text-format' => '>= 1.0.0',
231
+ 'tmail' => '>= 1.2.3.1',
232
+ 'diff-lcs' => '>= 1.1.2',
233
+ 'tidy-ext' => '>= 0.1.10',
218
234
  'rake-compiler' => '>= 0.7.0',
219
235
  }
220
236
 
@@ -241,7 +257,7 @@ GEMSPEC = Gem::Specification.new do |gem|
241
257
 
242
258
  gem.has_rdoc = true
243
259
  gem.rdoc_options = RDOC_OPTIONS
244
- gem.extra_rdoc_files = %w[ChangeLog README LICENSE]
260
+ gem.extra_rdoc_files = TEXT_FILES - [ 'Rakefile' ]
245
261
 
246
262
  gem.bindir = BINDIR.relative_path_from(BASEDIR).to_s
247
263
  gem.executables = BIN_FILES.select {|pn| File.executable?(pn) }.
@@ -255,6 +271,10 @@ GEMSPEC = Gem::Specification.new do |gem|
255
271
  gem.files = RELEASE_FILES
256
272
  gem.test_files = SPEC_FILES
257
273
 
274
+ # signing key and certificate chain
275
+ gem.signing_key = '/Volumes/Keys/ged-private_gem_key.pem'
276
+ gem.cert_chain = [File.expand_path('~/.gem/ged-public_gem_cert.pem')]
277
+
258
278
  DEPENDENCIES.each do |name, version|
259
279
  version = '>= 0' if version.length.zero?
260
280
  gem.add_runtime_dependency( name, version )
@@ -295,7 +315,7 @@ import LOCAL_RAKEFILE if LOCAL_RAKEFILE.exist?
295
315
  #####################################################################
296
316
 
297
317
  ### Default task
298
- task :default => [:clean, :local, :spec, :rdoc, :package]
318
+ task :default => [:clean, :local, :spec, :apidocs, :package]
299
319
 
300
320
  ### Task the local Rakefile can append to -- no-op by default
301
321
  task :local
data/Rakefile.local CHANGED
@@ -1,11 +1,17 @@
1
1
  #!rake
2
2
 
3
+ require 'rbconfig'
3
4
  require 'rake/extensiontask'
4
5
 
5
6
  # C extension constants
6
- EXT_MAKEFILE = EXTDIR + 'Makefile'
7
- EXT_SOURCES = FileList[ EXTDIR + '*.c' ]
8
- EXT_SO = EXTDIR + "bluecloth_ext.#{CONFIG['DLEXT']}"
7
+ ARCH = Config::CONFIG['arch']
8
+ ARCHLIBDIR = LIBDIR + ARCH
9
+
10
+ EXT_MAKEFILE = EXTDIR + 'Makefile'
11
+ EXT_SOURCES = FileList[ EXTDIR + '*.c' ]
12
+ EXT_SO = EXTDIR + "bluecloth_ext.#{CONFIG['DLEXT']}"
13
+
14
+
9
15
 
10
16
  GEMSPEC.extra_rdoc_files << 'LICENSE.discount'
11
17
  DOCFILES << 'LICENSE.discount'
@@ -25,13 +31,14 @@ namespace :spec do
25
31
  task :text => [ :compile ]
26
32
  end
27
33
 
28
- ENV['RUBY_CC_VERSION'] = '1.8.6:1.9.1'
34
+
35
+ ENV['RUBY_CC_VERSION'] = '1.8.6:1.9.2'
29
36
 
30
37
  Rake::ExtensionTask.new do |ext|
31
38
  ext.name = 'bluecloth_ext'
32
39
  ext.gem_spec = GEMSPEC
33
- ext.ext_dir = 'ext'
34
- ext.lib_dir = 'lib'
40
+ ext.ext_dir = EXTDIR.to_s
41
+ ext.lib_dir = LIBDIR.to_s
35
42
  ext.source_pattern = "*.{c,h}"
36
43
  ext.cross_compile = true
37
44
  ext.cross_platform = %w[i386-mswin32 i386-mingw32]
data/ext/VERSION CHANGED
@@ -1 +1 @@
1
- 1.5.8
1
+ 1.6.8
data/ext/bluecloth.c CHANGED
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  * BlueCloth -- a Ruby implementation of Markdown
3
- * $Id$
3
+ * $Id: bluecloth.c,v 1caa0c888dfe 2010/09/17 22:03:06 ged $
4
4
  *
5
5
  * = Authors
6
6
  *
@@ -32,11 +32,11 @@ VALUE bluecloth_default_opthash;
32
32
  static MMIOT *
33
33
  bluecloth_alloc( VALUE text, int flags ) {
34
34
  MMIOT *document;
35
-
35
+
36
36
  document = mkd_string( RSTRING_PTR(text), RSTRING_LEN(text), flags );
37
37
  if ( !document )
38
38
  rb_raise( rb_eRuntimeError, "Failed to create a BlueCloth object for: %s", RSTRING_PTR(text) );
39
-
39
+
40
40
  return document;
41
41
  }
42
42
 
@@ -44,7 +44,7 @@ bluecloth_alloc( VALUE text, int flags ) {
44
44
  /*
45
45
  * GC Free function
46
46
  */
47
- static void
47
+ static void
48
48
  bluecloth_gc_free( MMIOT *document ) {
49
49
  if ( document ) {
50
50
  mkd_cleanup( document );
@@ -100,7 +100,7 @@ bluecloth_check_ptr( VALUE self ) {
100
100
  rb_raise( rb_eTypeError, "wrong argument type %s (expected BlueCloth object)",
101
101
  rb_class2name(CLASS_OF( self )) );
102
102
  }
103
-
103
+
104
104
  return DATA_PTR( self );
105
105
  }
106
106
 
@@ -181,11 +181,11 @@ bluecloth_s_discount_version( VALUE klass ) {
181
181
  * superscript notation. Defaults to +true+.
182
182
  *
183
183
  */
184
- static VALUE
184
+ static VALUE
185
185
  bluecloth_initialize( int argc, VALUE *argv, VALUE self ) {
186
186
  if ( !bluecloth_check_ptr(self) ) {
187
187
  MMIOT *document;
188
- VALUE text, textcopy, optflags, fullhash, opthash = Qnil;
188
+ VALUE text, utf8text, optflags, fullhash, opthash = Qnil;
189
189
  int flags = 0;
190
190
 
191
191
  rb_scan_args( argc, argv, "02", &text, &opthash );
@@ -201,7 +201,7 @@ bluecloth_initialize( int argc, VALUE *argv, VALUE self ) {
201
201
  text = rb_str_new( "", 0 );
202
202
  }
203
203
  else {
204
- text = rb_obj_as_string( text );
204
+ text = rb_obj_dup( rb_obj_as_string(text) );
205
205
  }
206
206
 
207
207
  /* Merge the options hash with the defaults and turn it into a flags int */
@@ -210,13 +210,21 @@ bluecloth_initialize( int argc, VALUE *argv, VALUE self ) {
210
210
  fullhash = rb_funcall( bluecloth_cBlueCloth, rb_intern("opthash_from_flags"), 1, optflags );
211
211
 
212
212
  flags = NUM2INT( optflags );
213
+
214
+ #ifdef M17N_SUPPORTED
215
+ bluecloth_debug( "Bytes before utf8ification: %s",
216
+ RSTRING_PTR(rb_funcall(text, rb_intern("dump"), 0, Qnil)) );
217
+ utf8text = rb_str_export_to_enc( rb_str_dup(text), rb_utf8_encoding() );
218
+ DATA_PTR( self ) = document = bluecloth_alloc( utf8text, flags );
219
+ #else
213
220
  DATA_PTR( self ) = document = bluecloth_alloc( text, flags );
221
+ #endif /* M17N_SUPPORTED */
222
+
214
223
  if ( !mkd_compile(document, flags) )
215
224
  rb_raise( rb_eRuntimeError, "Failed to compile markdown" );
216
225
 
217
- textcopy = rb_str_dup( text );
218
- OBJ_FREEZE( textcopy );
219
- rb_iv_set( self, "@text", textcopy );
226
+ OBJ_FREEZE( text );
227
+ rb_iv_set( self, "@text", text );
220
228
  OBJ_FREEZE( fullhash );
221
229
  rb_iv_set( self, "@options", fullhash );
222
230
 
@@ -242,12 +250,20 @@ bluecloth_to_html( VALUE self ) {
242
250
  VALUE result = Qnil;
243
251
 
244
252
  bluecloth_debug( "Compiling document %p", document );
245
-
253
+
246
254
  if ( (length = mkd_document( document, &output )) != EOF ) {
247
- bluecloth_debug( "Pointer to results: %p, length = %d", output, length );
255
+ #ifdef M17N_SUPPORTED
256
+ VALUE orig_encoding = rb_obj_encoding( rb_iv_get(self, "@text") );
257
+ VALUE utf8_result = rb_enc_str_new( output, length, rb_utf8_encoding() );
258
+ result = rb_str_encode( utf8_result, orig_encoding, 0, Qnil );
259
+ bluecloth_debug( "Bytes after un-utf8ification (if necessary): %s",
260
+ RSTRING_PTR(rb_funcall(result, rb_intern("dump"), 0, Qnil)) );
261
+ #else
248
262
  result = rb_str_new( output, length );
263
+ #endif /* M17N_SUPPORTED */
249
264
 
250
265
  OBJ_INFECT( result, self );
266
+
251
267
  return result;
252
268
  } else {
253
269
  return Qnil;
@@ -283,7 +299,7 @@ bluecloth_header( VALUE self ) {
283
299
  VALUE fieldstring, headers = rb_hash_new();
284
300
 
285
301
  bluecloth_debug( "Fetching pandoc headers for document %p", document );
286
-
302
+
287
303
  if ( (field = mkd_doc_title(document)) ) {
288
304
  fieldstring = rb_str_new2( field );
289
305
  OBJ_INFECT( fieldstring, self );
@@ -312,6 +328,9 @@ bluecloth_header( VALUE self ) {
312
328
  void Init_bluecloth_ext( void ) {
313
329
  bluecloth_cBlueCloth = rb_define_class( "BlueCloth", rb_cObject );
314
330
 
331
+ mkd_with_html5_tags();
332
+ mkd_initialize();
333
+
315
334
  rb_define_alloc_func( bluecloth_cBlueCloth, bluecloth_s_allocate );
316
335
  rb_define_singleton_method( bluecloth_cBlueCloth, "discount_version",
317
336
  bluecloth_s_discount_version, 0 );
@@ -321,10 +340,10 @@ void Init_bluecloth_ext( void ) {
321
340
  rb_define_method( bluecloth_cBlueCloth, "to_html", bluecloth_to_html, 0 );
322
341
  rb_define_method( bluecloth_cBlueCloth, "header", bluecloth_header, 0 );
323
342
  rb_define_alias( bluecloth_cBlueCloth, "pandoc_header", "header" );
324
-
343
+
325
344
  /* The original Markdown text the object was constructed with */
326
345
  rb_define_attr( bluecloth_cBlueCloth, "text", 1, 0 );
327
-
346
+
328
347
  /* The options hash that describes the options in effect when the object was created */
329
348
  rb_define_attr( bluecloth_cBlueCloth, "options", 1, 0 );
330
349
 
@@ -339,22 +358,28 @@ void Init_bluecloth_ext( void ) {
339
358
 
340
359
  /* Do not do Smartypants-style mangling of quotes, dashes, or ellipses. */
341
360
  rb_define_const( bluecloth_cBlueCloth, "MKD_NOPANTS", INT2FIX(MKD_NOPANTS) );
342
-
361
+
343
362
  /* Escape all opening angle brackets in the input text instead of allowing block-level HTML */
344
363
  rb_define_const( bluecloth_cBlueCloth, "MKD_NOHTML", INT2FIX(MKD_NOHTML) );
345
364
 
346
365
  /* disable SUPERSCRIPT, RELAXED_EMPHASIS */
347
366
  rb_define_const( bluecloth_cBlueCloth, "MKD_STRICT", INT2FIX(MKD_STRICT) );
348
-
367
+
349
368
  /* process text inside an html tag; no <em>, no <bold>, no html or [] expansion */
350
369
  rb_define_const( bluecloth_cBlueCloth, "MKD_TAGTEXT", INT2FIX(MKD_TAGTEXT) );
351
-
370
+
352
371
  /* don't allow pseudo-protocols */
353
372
  rb_define_const( bluecloth_cBlueCloth, "MKD_NO_EXT", INT2FIX(MKD_NO_EXT) );
354
-
373
+
374
+ /* disallow tables */
375
+ rb_define_const( bluecloth_cBlueCloth, "MKD_NOTABLES", INT2FIX(MKD_NOTABLES) );
376
+
377
+ /* forbid ~~strikethrough~~ */
378
+ rb_define_const( bluecloth_cBlueCloth, "MKD_NOSTRIKETHROUGH", INT2FIX(MKD_NOSTRIKETHROUGH) );
379
+
355
380
  /* do table-of-contents processing */
356
381
  rb_define_const( bluecloth_cBlueCloth, "MKD_TOC", INT2FIX(MKD_TOC) );
357
-
382
+
358
383
  /* MarkdownTest 1.0 Compatibility Mode */
359
384
  rb_define_const( bluecloth_cBlueCloth, "MKD_1_COMPAT", INT2FIX(MKD_1_COMPAT) );
360
385
 
data/ext/bluecloth.h CHANGED
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  * BlueCloth -- a Ruby implementation of Markdown
3
- * $Id$
3
+ * $Id: bluecloth.h,v 055519ec5f78 2010/09/17 20:42:27 ged $
4
4
  *
5
5
  */
6
6
 
@@ -8,12 +8,23 @@
8
8
  #define BLUECLOTH_H
9
9
 
10
10
  #include "config.h"
11
+ #include "assert.h"
11
12
 
12
13
  #include "mkdio.h"
13
14
  #include "ruby.h"
14
15
 
15
- #ifdef HAVE_RUBY_ENCODING_H
16
+ void mkd_initialize _(( void ));
17
+ void mkd_with_html5_tags _(( void ));
18
+
19
+ #if defined(HAVE_RUBY_ENCODING_H) && HAVE_RUBY_ENCODING_H
20
+ # define M17N_SUPPORTED
16
21
  # include "ruby/encoding.h"
17
22
  #endif
18
23
 
24
+ /* Replace the macro from encoding.h that refers to static 'rb_encoding_list' */
25
+ #ifdef ENC_FROM_ENCINDEX
26
+ #undef ENC_FROM_ENCINDEX
27
+ #define ENC_FROM_ENCINDEX(idx) (rb_enc_from_index(idx))
28
+ #endif
29
+
19
30
  #endif