From 6f36e532903f22d79a9a18d1cf79a94527a5ebd7 Mon Sep 17 00:00:00 2001 From: Alexey Verkhovsky Date: Sun, 10 Apr 2005 17:10:11 +0000 Subject: [PATCH] BlueCloth is back with vengeance --- CHANGELOG | 4 +--- app/models/chunks/engines.rb | 2 +- config/environment.rb | 1 + instiki.gemspec | 1 + test/unit/revision_test.rb | 14 +++++++------- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 1b02e38a..2b5c962d 100755 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,9 +1,7 @@ - * TODO: - BlueCloth is back (RedCloth didn't do Markdown well enough to replace it). - * SVN trunk: Handling of line breaks in Textile is as in 0.9 (inserts
tag). Upgraded rubyzip to version 0.5.8 + BlueCloth is back (RedCloth didn't do pure Markdown well enough to replace it yet) * 0.10.0: Ported to ActionPack RedCloth 3.0.3 diff --git a/app/models/chunks/engines.rb b/app/models/chunks/engines.rb index 6378f843..10ee6069 100644 --- a/app/models/chunks/engines.rb +++ b/app/models/chunks/engines.rb @@ -33,7 +33,7 @@ module Engines class Markdown < AbstractEngine def mask - RedCloth.new(@content, @content.options[:engine_opts]).to_html(:block_textile_lists, :inline_textile_span, :markdown) + BlueCloth.new(@content, @content.options[:engine_opts]).to_html end end diff --git a/config/environment.rb b/config/environment.rb index fd396c95..7641ff38 100644 --- a/config/environment.rb +++ b/config/environment.rb @@ -38,6 +38,7 @@ unless defined? ADDITIONAL_LOAD_PATHS vendor/rails/actionwebservice/lib vendor/madeleine-0.7.1/lib vendor/RedCloth-3.0.3/lib + vendor/BlueCloth-1.0.0/lib vendor/rubyzip-0.5.8/lib ).map { |dir| "#{File.expand_path(File.join(RAILS_ROOT, dir))}" }.delete_if { |dir| not File.exist?(dir) } diff --git a/instiki.gemspec b/instiki.gemspec index 34e0e7fb..31bec873 100755 --- a/instiki.gemspec +++ b/instiki.gemspec @@ -26,6 +26,7 @@ spec = Gem::Specification.new do |s| s.add_dependency('madeleine', '= 0.7.1') s.add_dependency('RedCloth', '= 3.0.3') + s.add_dependency('BlueCloth', '= 1.0.0') s.add_dependency('rubyzip', '= 0.5.8') s.add_dependency('rails', '= 0.11.1') s.requirements << 'none' diff --git a/test/unit/revision_test.rb b/test/unit/revision_test.rb index f8cd3cad..121ca340 100755 --- a/test/unit/revision_test.rb +++ b/test/unit/revision_test.rb @@ -54,7 +54,7 @@ class RevisionTest < Test::Unit::TestCase @web.markup = :markdown assert_markup_parsed_as( - %{

My Headline

\n\n\n\t

that } + + %{

My Headline

\n\n

that } + %{Smart Engine GUI?

}, "My Headline\n===========\n\nthat SmartEngineGUI") @@ -68,8 +68,8 @@ class RevisionTest < Test::Unit::TestCase ].join("\n") assert_markup_parsed_as( - %{

This is a code block:

\n\n\n\t
def a_method(arg)\n} +
-	    %{return ThatWay
\n\n\n\t

Nice!

}, + %{

This is a code block:

\n\n
def a_method(arg)\n} +
+	    %{return ThatWay\n
\n\n

Nice!

}, code_block) textile_and_markdown = [ @@ -85,10 +85,10 @@ class RevisionTest < Test::Unit::TestCase ].join("\n") assert_markup_parsed_as( - "

Markdown heading

\n\n\n\t" + - "

h2. Textile heading

\n\n\n\t" + - "

some text with styles

\n\n\n\t" + - "", + "

Markdown heading

\n\n" + + "

h2. Textile heading

\n\n" + + "

some text with -styles-

\n\n" + + "", textile_and_markdown) end