Closed timoschilling closed 8 years ago
Some debugging informations: Based on the pervious code the compiled template source is:
_buf = []; _buf << ("<ul>\n".freeze);
; (1..3).each do |i|;
; _hamlit_compiler1 = ''; _hamlit_compiler1 << ("<li>".freeze); _hamlit_compiler2 = (i;
; ); _hamlit_compiler1 << ((_hamlit_compiler2).to_s); _hamlit_compiler1 << ("</li>\n".freeze); _hamlit_compiler1; end; _buf << ("</ul>\n".freeze); _buf = _buf.join
The same template rendered with the hamlit comandline tool results in:
bundle exec hamlit compile file.haml
_buf = []; _buf << ("<ul>\n".freeze);
; (1..3).each do |i|;
; _buf << ("<li>".freeze); _hamlit_compiler1 = (i;
; ); _buf << (::Hamlit::Utils.escape_html((_hamlit_compiler1))); _buf << ("</li>\n".freeze); end; _buf << ("</ul>\n".freeze); _buf = _buf.join
bundle exec hamlit render file.haml
brings the expected result:
<ul>
<li>1</li>
<li>2</li>
<li>3</li>
</ul>
What am I doing wrong?
Both cases use hamlit 2.2.2
Are you using hamlit-block?
See https://github.com/k0kubun/hamlit/issues/53#issuecomment-170331999, https://github.com/k0kubun/hamlit/issues/53#issuecomment-170334043 and https://github.com/k0kubun/hamlit/issues/53#issuecomment-170524664 for detail. This may be not a bug within Hamlit but a feature of hamlit-block.
Yes, I use hamlit-block
. I'm the guy way nick has written #53. ;)
I close this as double of hamlit/hamlit-block#1
Context: I use a hand build render way:
Template:
Result: