mirror of
https://github.com/haml/haml.git
synced 2022-11-09 12:33:31 -05:00
[Haml] Make <code> tags automatically preserved.
This commit is contained in:
parent
565655766a
commit
bbca715be5
3 changed files with 19 additions and 2 deletions
|
@ -11,6 +11,9 @@
|
|||
* Fixed an `html2haml` issue where `#{}` wasn't escaped
|
||||
before being transformed into Haml.
|
||||
|
||||
* Add `<code>` to the list of tags that's
|
||||
{file:HAML_REFERENCE.md#preserve-option automatically whitespace-preserved}.
|
||||
|
||||
## [2.2.6](http://github.com/nex3/haml/commit/2.2.6)
|
||||
|
||||
* Made the error message when unable to load a dependency for html2haml
|
||||
|
|
|
@ -72,9 +72,10 @@ module Haml
|
|||
:suppress_eval => false,
|
||||
:attr_wrapper => "'",
|
||||
|
||||
# Don't forget to update the docs in lib/haml.rb if you update these
|
||||
# Don't forget to update the docs in doc-src/HAML_REFERENCE.md
|
||||
# if you update these
|
||||
:autoclose => %w[meta img link br hr input area param col base],
|
||||
:preserve => %w[textarea pre],
|
||||
:preserve => %w[textarea pre code],
|
||||
|
||||
:filename => '(haml)',
|
||||
:line => 1,
|
||||
|
|
|
@ -227,6 +227,19 @@ HAML
|
|||
SOURCE
|
||||
end
|
||||
|
||||
def test_pre_code
|
||||
assert_equal(<<HTML, render(<<HAML))
|
||||
<pre><code>Foo
 bar
 baz</code></pre>
|
||||
HTML
|
||||
%pre
|
||||
%code
|
||||
:preserve
|
||||
Foo
|
||||
bar
|
||||
baz
|
||||
HAML
|
||||
end
|
||||
|
||||
def test_boolean_attributes
|
||||
assert_equal("<p bar baz='true' foo='bar'></p>\n",
|
||||
render("%p{:foo => 'bar', :bar => true, :baz => 'true'}", :format => :html4))
|
||||
|
|
Loading…
Add table
Reference in a new issue