1
0
Fork 0
mirror of https://github.com/haml/haml.git synced 2022-11-09 12:33:31 -05:00

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