ariatemplates/hashspace — pull request #287 by mlaval (2014-09-10 17:04:21+00:00)
Title: White space management - DO NOT MERGE

This is a proposition to solve issues #68 and #285 which exist because hashspace strips white space and line return characters. Before moving forward by optimizing and fixing all failing tests (76 in compiler, 100 in RT !!!), I'd like to collect some feedback.

The basic idea behind this PR is to keep all these characters and to let browsers manage them.
To do so, the PEGJS parser now keeps everything and creates many `text` or `eol` blocks.
Optimizations (i.e. skipping some blocks) is done by the tree builder. Only one rule for the moment: EOL and withe spaces are skipped in a line if it contains only hashspace blocks which won't appear in the DOM ("if", "elseif", "else", "endif", "comment", "foreach", "endforeach", "eol", "log", "let").

With that changes, the following template behaves as expected:
```
{template test()}

OneTwo

One
Two

abc
def
ghij

{/template}
```

The main drawback is that compiled templates are bigger due to extra text nodes ...

Please discuss this approach.