I think this can't always be done at compile time, for instance when the line contains interpolations.

e.g. the following code would break if it was escaped before interpolation handling:

```
:escaped
    foo #{$foo < 1 ? "bar" : "baz"}
```

We could separate parsing from filtering/rendering in the interface. Do enter() and leave() need to be two separate functions ? What do you think about an interface like this ?

```
interface {
    function parseLine($buf, ...);
    function render($nodes, ...);
    function optimizable();
}
```

`render()` would take care of header/footer (e.g. `<script>` and `</script>`) and of filtering the content.

It would be called when the template is *executed*.

As an optimization we could pre-render and replace the whole Filter node by a Text node if `optimizable()` returns true (e.g. when there are no interpolations, or if the filter decides so).

What do you think ?