chjj/liquor — Issue #2: Account for whitespace
Author: derdesign
Created: 2012-01-04 22:57:12+00:00
State: open

Hi there,

I've just implemented your engine in [CoreJS](https://github.com/derdesign/CoreJS).

Maybe I'm missing something, but I think the rendered output doesn't account for whitespace in the generated code. For example, consider the following code:

```javascript
var liquor = require('liquor'),
template = '

#{title}

\n\n

Hello #{name}

\n\n\n\n

Howdy

';

// template = template.replace(/\n/gm, '\\n\n');

var tpl = liquor.compile(template),
buf = tpl({name: 'Ernie', title: 'My Application'});

console.log(buf);
process.exit();
```

This renders the following:

My Application

Hello Ernie

Howdy

If you uncomment the line in the code above, it fixes the white space and it renders as written.

Maybe adding a `pretty` option would do good. Sorry if I missed something!

Regards,
Ernie.-