SE7ENSKY / jade2php

Unlock Jade for PHP! Convert Jade templates into raw PHP templates. CLI tool and JavaScript API. Test covered.
43 stars 10 forks source link

'buf.push(...)' appears on the output #21

Closed OnkelTem closed 9 years ago

OnkelTem commented 9 years ago

This simple template:

div foo
!= data
if myvar
  div bar

produces the output:

buf.push(
<div>foo</div><?= $data ?>);
<?php if ($myvar) : ?>

<div>bar</div>
<?php endif ?>
OnkelTem commented 9 years ago

Seems like some code is still jade-like: https://github.com/SE7ENSKY/jade2php/blob/master/src/JadePhpCompiler.coffee#L187

Can this be rewritten as here: https://github.com/SE7ENSKY/jade2php/blob/master/src/JadePhpCompiler.coffee#L163 — i.e. by removing 'buf.push' stuff?