./pimki.rb in Pimki-1.2.092 vs ./pimki.rb in Pimki-1.3.092
- old
+ new
@@ -8,18 +8,37 @@
# Handle rubygems support & loading libraries: {{{
$LOAD_PATH.unshift File.join(File.dirname(__FILE__), "libraries")
begin
require 'rubygems'
require_gem 'madeleine'
- require_gem 'redcloth', '~> 2.0.11'
+ require_gem 'RedCloth'
require_gem 'rubyzip'
- require_gem 'bluecloth'
-rescue LoadError
+rescue LoadError => detail
# no rubygems, so load from the libraries directory
+ p detail
require 'redcloth'
- require 'bluecloth'
+ require 'bluecloth'
end
+
+### RedCloth Modifications:
+# Remove the "caps" spanning:
+RedCloth::GLYPHS.delete_if { |glyph| glyph[1] =~ /class=\"caps\"/ }
+# Fix missing hard_break
+if RedCloth::VERSION == '3.0.0'
+ class RedCloth #{{{
+ alias_method :old_clean_white_space, :clean_white_space
+ def clean_white_space text
+ old_clean_white_space text
+ hard_break text
+ end
+ end #}}}
+else
+ # Redcloth v3.0.0 can handle markdown, so BlueCloth is only required if we
+ # have an earlier redcloth version.
+ require 'BlueCloth'
+end
+
# }}}
# Handle command-line options: {{{
require 'optparse'
\ No newline at end of file