From 598e4f272dc9451ff7497a5798c781a32041b9fa Mon Sep 17 00:00:00 2001 From: Alexey Verkhovsky Date: Sun, 1 May 2005 02:47:57 +0000 Subject: [PATCH] Mixed mode that doesn't break on images --- app/models/chunks/engines.rb | 6 ++++-- test/unit/revision_test.rb | 6 ++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/app/models/chunks/engines.rb b/app/models/chunks/engines.rb index da8b5ed8..fe5a96a8 100644 --- a/app/models/chunks/engines.rb +++ b/app/models/chunks/engines.rb @@ -43,8 +43,10 @@ module Engines class Mixed < AbstractEngine def mask - RedCloth.new(@content, @content.options[:engine_opts]).to_html( - :textile, :markdown) + redcloth = RedCloth.new(@content, @content.options[:engine_opts]) + redcloth.filter_html = false + redcloth.no_span_caps = false + redcloth.to_html end end diff --git a/test/unit/revision_test.rb b/test/unit/revision_test.rb index 941161c6..44252a87 100755 --- a/test/unit/revision_test.rb +++ b/test/unit/revision_test.rb @@ -302,6 +302,12 @@ class RevisionTest < Test::Unit::TestCase list_with_tildas) end + def test_textile_image_in_mixed_wiki + @web.markup = :mixed + assert_markup_parsed_as( + "

\"\"\nss

", + "!http://google.com!\r\nss") + end def assert_markup_parsed_as(expected_output, input)