walmartlabs/thorax — pull request #288 by trombom (2013-12-16 03:45:48+00:00)
Title: encode output of url helper when using expands-tokens=true

The following should produce the same output:

```handlebars
The url is: {{url "articles" slug}}
The url is: {{url "articles/{{slug}}" expand-tokens=true}}
```

however, the output, respectively is:

```
The url is: #articles/hello%20world%2C%20sup! // correct
The url is: #articles/hello world, sup! // INCORRECT, not url encoded
```

I’ve written a failing test case (and a passing one for the first
example). However, the two use very different code paths. The first uses
javascripts built in `encodeURIComponent` method while the second uses
`Thorax.Util.expandToken`, which seems to be much more general purpose

I do not mind digging in if the fix is not immediately obvious, i put
comments in the tests pointing to the relevant code paths

/cc @eastridge