From ee876a2907828297c437a2fee15fe0b41897d86b Mon Sep 17 00:00:00 2001 From: Alexey Verkhovsky Date: Sun, 10 Apr 2005 03:18:10 +0000 Subject: [PATCH] Added some Textile rules to markdown option, in an attempt to force RedCloth to _really_ render Markdown --- app/models/chunks/engines.rb | 2 +- test/unit/revision_test.rb | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/app/models/chunks/engines.rb b/app/models/chunks/engines.rb index 8e9e08ce..6378f843 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(:markdown) + RedCloth.new(@content, @content.options[:engine_opts]).to_html(:block_textile_lists, :inline_textile_span, :markdown) end end diff --git a/test/unit/revision_test.rb b/test/unit/revision_test.rb index c939ad65..f8cd3cad 100755 --- a/test/unit/revision_test.rb +++ b/test/unit/revision_test.rb @@ -71,6 +71,26 @@ class RevisionTest < Test::Unit::TestCase %{

This is a code block:

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

Nice!

}, code_block) + + textile_and_markdown = [ + 'Markdown heading', + '================', + '', + 'h2. Textile heading', + '', + '*some* **text** _with_ -styles-', + '', + '* list 1', + '* list 2' + ].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" + + "", + textile_and_markdown) + end def test_rdoc