Automatically #find_and_preserve filters that use #render.

This commit is contained in:
Nathan Weizenbaum 2008-05-13 11:23:11 -07:00
parent 535c40c47d
commit 8c92d2cb9b
3 changed files with 16 additions and 4 deletions

View File

@ -68,7 +68,7 @@ module Haml
return
end
rendered = filter.render(text)
rendered = Haml::Helpers::find_and_preserve(filter.render(text), precompiler.options[:preserve])
if !options[:ugly]
push_text(rendered.rstrip.gsub("\n", "\n#{' ' * @output_tabs}"))

View File

@ -11,9 +11,7 @@ TESTING HAHAHAHA!
<h1>Foo</h1>
<pre><code>This is preformatted!
Look at that!
Wowie-zowie!</code></pre>
<pre><code>This is preformatted!&#x000A;Look at that!&#x000A;Wowie-zowie!</code></pre>
<p><strong>boldilicious!</strong></p>
@ -69,6 +67,12 @@ This
</ul>
<div class='res'>178</div>
<p>
<p>I like preserved text:</p>
<pre><code>Foo&#x000A; Bar!&#x000A;Baz</code></pre>
</p>
<ul>
<li>Foo</li>
<li>Bar</li>

View File

@ -68,6 +68,14 @@
.res= res
%p
:textile
I like preserved text:
Foo
Bar!
Baz
:markdown
* Foo
* Bar