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

[Haml] Removed trailing whitespace from conditional comment openings.

This commit is contained in:
Norman Clarke 2009-09-15 16:56:28 -03:00 committed by Nathan Weizenbaum
parent 09cda35a99
commit 483e8a56e8
2 changed files with 8 additions and 8 deletions

View file

@ -109,8 +109,8 @@ END
names.map do |name|
# Can't use || because someone might explicitly pass in false with a symbol
sym_local = "_haml_locals[#{name.to_sym.inspect}]"
str_local = "_haml_locals[#{name.to_s.inspect}]"
sym_local = "_haml_locals[#{name.to_sym.inspect}]"
str_local = "_haml_locals[#{name.to_s.inspect}]"
"#{name} = #{sym_local}.nil? ? #{str_local} : #{sym_local}"
end.join(';') + ';'
end
@ -719,7 +719,7 @@ END
else
open_tag << "\n" unless parse || nuke_inner_whitespace || (self_closing && nuke_outer_whitespace)
end
push_merged_text(open_tag, tag_closed || self_closing || nuke_inner_whitespace ? 0 : 1,
!nuke_outer_whitespace)
@ -775,11 +775,11 @@ END
raise SyntaxError.new('Illegal nesting: nesting within a tag that already has content is illegal.', @next_line.index)
end
open = "<!--#{conditional} "
open = "<!--#{conditional}"
# Render it statically if possible
unless line.empty?
return push_text("#{open}#{line} #{conditional ? "<![endif]-->" : "-->"}")
return push_text("#{open} #{line} #{conditional ? "<![endif]-->" : "-->"}")
end
push_text(open, 1)

View file

@ -26,7 +26,7 @@ stuff followed by whitespace
yee\ha
</p>
<!-- Short comment -->
<!--
<!--
This is a block comment
cool, huh?
<strong>there can even be sub-tags!</strong>
@ -35,13 +35,13 @@ stuff followed by whitespace
<p class=''>class attribute should appear!</p>
<p>this attribute shouldn't appear</p>
<!--[if lte IE6]> conditional comment! <![endif]-->
<!--[if gte IE7]>
<!--[if gte IE7]>
<p>Block conditional comment</p>
<div>
<h1>Cool, eh?</h1>
</div>
<![endif]-->
<!--[if gte IE5.2]>
<!--[if gte IE5.2]>
Woah a period.
<![endif]-->
testtest